in reply to Re^3: how to read multiple line from a file
in thread how to read multiple line from a file
If a sliding window is needed, shift and push might be better.This leads to extra memmove()s if you're lucky (I believe Perl does this), and endless memory consumption otherwise. If you use the mod operator when indexing your array, you get a ring buffer without excess copying. You could probably abstract this out nicely with a bit of extra work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: how to read multiple line from a file
by LanX (Saint) on Apr 14, 2013 at 19:43 UTC | |
by educated_foo (Vicar) on Apr 14, 2013 at 20:56 UTC | |
by LanX (Saint) on Apr 14, 2013 at 21:08 UTC | |
by educated_foo (Vicar) on Apr 14, 2013 at 21:26 UTC | |
by LanX (Saint) on Apr 14, 2013 at 22:16 UTC | |
|