October 20, 2021, 11:22:47

Author Topic: Maybe a bug in array.sort()  (Read 239 times)

Offline imaginaryhuman

  • Jr. Member
  • **
  • Posts: 14
Maybe a bug in array.sort()
« on: April 04, 2021, 00:00:09 »
not sure if this is a thing. i have an array of 520,000 strings, each a length up to 150 chars. When i sort them I get a chunk of missing rows at the end in the Y-Z area. Yet, when I add a comma and some digits on the end of each string, for some reason that gives me the full output. not sure if its a bug or just something i'm doing.
« Last Edit: April 04, 2021, 00:12:12 by imaginaryhuman »

Offline col

  • Hero Member
  • *****
  • Posts: 599
Re: Maybe a bug in array.sort()
« Reply #1 on: April 04, 2021, 01:20:37 »
It would be an idea to post an example that shows the bug and some folks may look into it.

Offline Derron

  • Hero Member
  • *****
  • Posts: 3667
Re: Maybe a bug in array.sort()
« Reply #2 on: April 04, 2021, 08:23:39 »
Do you provide a custom sort() function?
Using NG?

With NG (more current versions) default array sort of strings will NOT sort by name - but by memory address. Behaviour was "changed" ... dunno ... about a year ago or so. It is or was never intented to be ensured to have an ABC-sort.

So ... if you think something is missing: is the array.length different afterwards?



SimplePortal 2.3.6 © 2008-2014, SimplePortal