isovic / graphmap

GraphMap - A highly sensitive and accurate mapper for long, error-prone reads http://www.nature.com/ncomms/2016/160415/ncomms11307/full/ncomms11307.html Note: This was the original repository which will no longer be officially maintained. Please use the new official repository here:
https://github.com/lbcb-sci/graphmap2
MIT License
178 stars 44 forks source link

avoid copying of stringstreams to determine its length #37

Closed tolot27 closed 7 years ago

tolot27 commented 7 years ago

For example in line: https://github.com/isovic/graphmap/blob/master/src/graphmap/process_read.cc#L522 ss.str() makes a copy of the whole string just to determine its length. I this case, ss.tellp() > 0 should be sufficient.

isovic commented 7 years ago

That's a good catch, thanks! I'll incorporate it in the next release.

Best regards, Ivan.

isovic commented 7 years ago

Hi, the suggestion has now been implemented in all such occurrences (only a couple though). Thanks again!