Re: Stdio.Buffer, need a way to revisit old positions in the output
"Stephen R. van den Berg" <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
Per Hedbor () @ Pike (-) importm?te f?r mailinglistan wrote: >Buffer sub = b->new_hbuffer(); >sub->add... >sub->finish(); >looks cleaner, I think. Well, it would appear so, however, do keep in mind that: a. The get_addpos() positions implicitly give me a way to find out how much bytes are between position A and B. So the length calculations I need are already there, whereas using a writable subbuffer like above doesn't give me those yet. b. Using the writeable subbuffer is tricky at best, and cannot be considered lightweight anymore; get/set_addpos are practically for free. -- Stephen.