diff --git a/src/object.d b/src/object.d index 854e7fae62..97a8e5e9cd 100644 --- a/src/object.d +++ b/src/object.d @@ -39,7 +39,7 @@ alias dstring = immutable(dchar)[]; version (D_ObjectiveC) public import core.attribute : selector; public import rt.array.comparison : __cmp; -public import rt.array.equality : __equals; +public import rt.array.equality : __ArrayEq, __equals; // Compare class and interface objects for ordering. private int __cmp(Obj)(Obj lhs, Obj rhs) @@ -4384,19 +4384,6 @@ private void _doPostblit(T)(T[] arr) auto a = arr.dup; // dup does escape } -// compiler frontend lowers dynamic array comparison to this -bool __ArrayEq(T1, T2)(T1[] a, T2[] b) -{ - if (a.length != b.length) - return false; - foreach (size_t i; 0 .. a.length) - { - if (a[i] != b[i]) - return false; - } - return true; -} - // compiler frontend lowers struct array postblitting to this void __ArrayPostblit(T)(T[] a) { diff --git a/src/rt/array/equality.d b/src/rt/array/equality.d index cbb00c989c..d02d49f892 100644 --- a/src/rt/array/equality.d +++ b/src/rt/array/equality.d @@ -8,7 +8,20 @@ * Source: $(DRUNTIMESRC rt/_array.d) */ - module rt.array.equality; +module rt.array.equality; + +// compiler frontend lowers dynamic array comparison to this +bool __ArrayEq(T1, T2)(T1[] a, T2[] b) +{ + if (a.length != b.length) + return false; + foreach (size_t i; 0 .. a.length) + { + if (a[i] != b[i]) + return false; + } + return true; +} // `lhs == rhs` lowers to `__equals(lhs, rhs)` for dynamic arrays bool __equals(T1, T2)(T1[] lhs, T2[] rhs)