diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-06-10T12·02+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-06-10T12·02+0200 |
commit | ee7fe64c0ac00f2be11604a2a6509eb86dc19f0a (patch) | |
tree | 2e27bc6d75ca28f3a8f598373b6fa716314b8aae /src/libexpr/eval.cc | |
parent | b1beed97a0670befbfd5e105a81132e87e58ac37 (diff) |
== operator: Ignore string context
There really is no case I can think of where taking the context into account is useful. Mostly it's just very inconvenient.
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r-- | src/libexpr/eval.cc | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 81ce7d9a3020..87b6bc991574 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -1355,17 +1355,8 @@ bool EvalState::eqValues(Value & v1, Value & v2) case tBool: return v1.boolean == v2.boolean; - case tString: { - /* Compare both the string and its context. */ - if (strcmp(v1.string.s, v2.string.s) != 0) return false; - const char * * p = v1.string.context, * * q = v2.string.context; - if (!p && !q) return true; - if (!p || !q) return false; - for ( ; *p && *q; ++p, ++q) - if (strcmp(*p, *q) != 0) return false; - if (*p || *q) return false; - return true; - } + case tString: + return strcmp(v1.string.s, v2.string.s) == 0; case tPath: return strcmp(v1.path, v2.path) == 0; |