Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #500 (closed defect: fixed)

Opened 17 years ago

Last modified 17 years ago

tango.text.Util.indexOf doesn't work right for wchar and dchar

Reported by: JarrettBillingsley Assigned to: kris
Priority: major Milestone: 0.99 RC3
Component: Core Functionality Version: trunk
Keywords: Cc:

Description

For wchar and dchar, I think the 'sar ESI' after the loop is unnecessary. This code:

for(char c = 'a'; c <= 'p'; c++)
	Stdout.formatln("{}", locate("abcdefghijklmno"c, c));

Stdout.newline;

for(dchar c = 'a'; c <= 'p'; c++)
	Stdout.formatln("{}", locate("abcdefghijklmno"d, c));

Shows what happens. For char it prints out 0 thru 15, as expected, but for dchar it prints something like "0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 15". Remove the 'sar ESI' and it works fine.

Change History

06/02/07 18:21:12 changed by kris

  • owner changed from sean to kris.
  • version changed from 0.98 RC2 to trunk.
  • milestone set to 0.99 RC3.

06/02/07 18:26:53 changed by kris

  • status changed from new to closed.
  • resolution set to fixed.

[2274]

Thanks, Jarrett! Must look into why indexOf() and mismatch() are different in that regard