[llvm] r183354 - Rename operator== parameter to `RHS`.

David Blaikie dblaikie at gmail.com
Thu Jun 6 10:26:42 PDT 2013


On Wed, Jun 5, 2013 at 4:58 PM, Sean Silva <silvas at purdue.edu> wrote:
> Author: silvas
> Date: Wed Jun  5 18:58:14 2013
> New Revision: 183354
>
> URL: http://llvm.org/viewvc/llvm-project?rev=183354&view=rev
> Log:
> Rename operator== parameter to `RHS`.
>
> The previous name `Ref` is overly generic.
>
> Modified:
>     llvm/trunk/include/llvm/Object/YAML.h
>
> Modified: llvm/trunk/include/llvm/Object/YAML.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/YAML.h?rev=183354&r1=183353&r2=183354&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Object/YAML.h (original)
> +++ llvm/trunk/include/llvm/Object/YAML.h Wed Jun  5 18:58:14 2013
> @@ -43,12 +43,12 @@ public:
>        return Data.size() / 2;
>      return Data.size();
>    }
> -  bool operator==(const BinaryRef &Ref) {
> +  bool operator==(const BinaryRef &RHS) {

Minor pedantry, if you're here - ideally this (& any other op overload
members that can be) should be a non-member. (for one thing, this op==
only accepts a non-const LHS (but the other thing is that having it as
a non-member keeps the behavior symmetric in cases of implicit
conversion of operands, etc))

>      // Special case for default constructed BinaryRef.
> -    if (Ref.Data.empty() && Data.empty())
> +    if (RHS.Data.empty() && Data.empty())
>        return true;
>
> -    return Ref.DataIsHexString == DataIsHexString && Ref.Data == Data;
> +    return RHS.DataIsHexString == DataIsHexString && RHS.Data == Data;
>    }
>    /// \brief Write the contents (regardless of whether it is binary or a
>    /// hex string) as binary to the given raw_ostream.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list