http://d.puremagic.com/issues/show_bug.cgi?id=11409


Iain Buclaw <ibuc...@ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |ibuc...@ubuntu.com
         Resolution|                            |INVALID


--- Comment #1 from Iain Buclaw <ibuc...@ubuntu.com> 2013-11-01 03:32:37 PDT ---
Your assumption is not quite right. This is the loop comparisons goes off:

for (size_t u = 0; u < len; u++)
{
    int result = s1[u] - s2[u];
    if (result)
        return result;
}


And in you examples:
---
Code:      assert([2, 0, 0] > [1, 1, 1]);
---
Generates: assert(compare(s1, s2) > 0);
---
Returns:   result = 2 - 1;  =>  return 1

---
Code:      assert([0, 2, 0] < [1, 1, 1]); 
---
Generates: assert(compare(s1, s2) < 0);
---
Returns:   result = 0 - 1;  =>  return -1;

---
Code:      assert([0, 0, 2] < [1, 1, 1]);
---
Generates: assert(compare(s1, s2) < 0);
---
Returns:   result = 0 - 1;  =>  return -1;



My advise to you would be to compare a *SORTED* array.

Marking as invalid because this is working as expected.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to