• Tim Peters's avatar
    Fiddled ms_getline_hack after talking w/ Guido: made clearer that the · 15b83852
    Tim Peters yazdı
    code duplication is to let us get away without a realloc whenever possible;
    boosted the init buf size (the cutoff at which we *can* get away without
    a realloc) from 100 to 200 so that more files can enjoy this boost; and
    allowed other threads to run in all cases.  The last two cost something,
    but not significantly:  in my fat test case, less than a 1% slowdown total.
    Since my test case has a great many short lines, that's probably the worst
    slowdown, too.  While the logic barely changed, there were lots of edits.
    This also gets rid of the reference to fp->_cnt, so the last platform
    assumption being made here is that fgets doesn't overwrite bytes
    capriciously (== beyond the terminating null byte it must write).
    15b83852
fileobject.c 32.7 KB