• Kevin Modzelewski's avatar
    Cache and reuse 1-length strings · 267a5116
    Kevin Modzelewski authored
    CPython does this and seems like a good thing to do.  Otherwise
    iterating over a string would cause lots of allocations.
    
    One difference between this implementation and cpython's is that cpython
    doesn't eagerly create them, and so it checks to see if they've been
    created or not.
    267a5116
types.cpp 104 KB