verachell / YeetWords

a domain-specific language for text substitution
GNU General Public License v3.0
13 stars 0 forks source link

fix: WRITE command can handle a larger (~50000W) repeat parameter #5

Closed verachell closed 2 years ago

verachell commented 2 years ago

Fixed by rewriting standard_write function to be iterative instead of recursive. Previously ruby was running out of stack space in many cases where the parameter was 50000W. Also added in this pull request is a very minor performance enhancement in select_random (called by standard_write) where if only 1 item is present, it picks the 1 item instead of generating a random number from 0 to 0.