Skip to content
  • Martin Hořeňovský's avatar
    912df7df
    Fix quadratic runtime when linebreaking strings without newlines · 912df7df
    Martin Hořeňovský authored
    The problem was that every line would iterate from current line
    start position to the end of the string, looking for a newline
    to break on, leading to accidentally quadratic runtime. With this
    change, the code only ever searches up to the current line's
    length and not more.
    
    Credit to @jorgenpt for the fix suggestion.
    
    Closes #2315
    912df7df
    Fix quadratic runtime when linebreaking strings without newlines
    Martin Hořeňovský authored
    The problem was that every line would iterate from current line
    start position to the end of the string, looking for a newline
    to break on, leading to accidentally quadratic runtime. With this
    change, the code only ever searches up to the current line's
    length and not more.
    
    Credit to @jorgenpt for the fix suggestion.
    
    Closes #2315
Loading