mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 17:51:01 +00:00
Fix for hash to match isEqual
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23966 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3481a3d002
commit
f03d22e63f
1 changed files with 24 additions and 19 deletions
|
@ -123,7 +123,12 @@
|
||||||
{
|
{
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
if (!sel_eq(((NSSortDescriptor*)other)->_selector, _selector))
|
/* FIXME ... we should use sel_eq to compare selectors, but if we do
|
||||||
|
* our implementation of -hash will be wrong ... so we will need to
|
||||||
|
* store all instances in a set to ensure uniqueness.
|
||||||
|
*/
|
||||||
|
// if (!sel_eq(((NSSortDescriptor*)other)->_selector, _selector))
|
||||||
|
if (((NSSortDescriptor*)other)->_selector != _selector)
|
||||||
{
|
{
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
@ -209,8 +214,8 @@ SortObjectsWithDescriptor(id * objects,
|
||||||
if (sortRange.length > 1)
|
if (sortRange.length > 1)
|
||||||
{
|
{
|
||||||
id pivot = objects[sortRange.location];
|
id pivot = objects[sortRange.location];
|
||||||
unsigned int left = sortRange.location + 1,
|
unsigned int left = sortRange.location + 1;
|
||||||
right = NSMaxRange(sortRange);
|
unsigned int right = NSMaxRange(sortRange);
|
||||||
|
|
||||||
while (left < right)
|
while (left < right)
|
||||||
{
|
{
|
||||||
|
@ -248,8 +253,8 @@ FindEqualityRanges(id * objects,
|
||||||
NSRange *ranges,
|
NSRange *ranges,
|
||||||
unsigned int *numRanges)
|
unsigned int *numRanges)
|
||||||
{
|
{
|
||||||
unsigned int i = searchRange.location,
|
unsigned int i = searchRange.location;
|
||||||
n = NSMaxRange(searchRange);
|
unsigned int n = NSMaxRange(searchRange);
|
||||||
|
|
||||||
if (n > 1)
|
if (n > 1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue