[Issue 5282] Use memcmp or other appropriate optimizations for array comparison where possible

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 28 09:06:54 PST 2010


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



--- Comment #2 from bearophile_hugs at eml.cc 2010-11-28 09:05:27 PST ---
The solution I suggest for this problem is: when DMD knows at compile-time the
length of one of the two strings to equate, and such length is small (like <
6), then it may replace the string eq code like this:

(c == "TAC")

With code like:

(c.length == 3 && c[0] == 'T' && c[1] == 'A' && c[2] == 'C')

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


More information about the Digitalmars-d-bugs mailing list