[Issue 9753] New: std.string.translate precondition asserts

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 18 15:11:04 PDT 2013


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

           Summary: std.string.translate precondition asserts
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-03-18 15:11:02 PDT ---
std.string.translate precondition contains code like this:


C[] translate(C = immutable char)(in char[] str, in char[] transTable, in
char[] toRemove = null) @trusted nothrow
    if(is(Unqual!C == char))
in
{
    assert(transTable.length == 256);
    foreach(char c; str)
        assert(c <= 256);
    foreach(char c; transTable)
        assert(c <= 256);
    foreach(char c; toRemove)
        assert(c <= 256);
}



I think those asserts should be:

assert(c < 256);

-- 
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