From 399b3fd198e27e64f342e7ef3151181aca4f66f2 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sun, 8 Mar 2015 19:03:35 +0100 Subject: [PATCH 1/2] documentation for the hash method --- Foundation/CPArray/_CPArray.j | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Foundation/CPArray/_CPArray.j b/Foundation/CPArray/_CPArray.j index ba2e0cd9f..42c44456f 100755 --- a/Foundation/CPArray/_CPArray.j +++ b/Foundation/CPArray/_CPArray.j @@ -208,6 +208,14 @@ var concat = Array.prototype.concat, _CPRaiseInvalidAbstractInvocation(self, _cmd); } +/*! + Returns a hash for the object. Other than in Cocoa, the hash value does not take the content into account. To distinct instances of CPArray with identical content (that are \c isEqual:) may return different \c -hash values. +*/ +- (unsigned)hash +{ + return [self UID]; +} + /*! Returns the first object in the array. If the array is empty, returns \c nil */ From 845a35a9b80c7de20a996bb314d816b015beea1a Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sun, 8 Mar 2015 20:49:01 +0100 Subject: [PATCH 2/2] rewording --- Foundation/CPArray/_CPArray.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/CPArray/_CPArray.j b/Foundation/CPArray/_CPArray.j index 42c44456f..5ba2124ba 100755 --- a/Foundation/CPArray/_CPArray.j +++ b/Foundation/CPArray/_CPArray.j @@ -209,7 +209,7 @@ var concat = Array.prototype.concat, } /*! - Returns a hash for the object. Other than in Cocoa, the hash value does not take the content into account. To distinct instances of CPArray with identical content (that are \c isEqual:) may return different \c -hash values. +Returns a hash for the object. Unlike Cocoa, the hash value does not take content into account, so two arrays with the same content (\c isEqual: === YES) will not generate the same hash. */ - (unsigned)hash {