sorting associative array's keys by values

Ali Çehreli acehreli at yahoo.com
Sat Jun 16 16:20:53 PDT 2012


On 06/16/2012 03:28 PM, maarten van damme wrote:

 > And the output I get is

It is possible that some part of the code is reusing a string buffer. 
For example, File.byLine does that.

 > tradeDocument=tradeDocument[1..$];

For that to work, you must ensure that tradeDocument has at least 2 
elements.

 > tradeDocument=tradeDocument[tradeDocument.countUntil("<div
 > class=\"")..$];//go to the next element

For that to work, you must have ensured that tradeDocument contains 
"<div class=\"". Otherwise countUntil() returns -1, an invalid index.

If those have not been ensured, I see two bugs in the lines above.

Ali

-- 
D Programming Language Tutorial: http://ddili.org/ders/d.en/index.html



More information about the Digitalmars-d-learn mailing list