Instead of heap allocating a string and copying nodes into, this patch makes node_buffer::get_nodes() return 2 ranges of bytes to be copied into the packet. This avoids heap allocations entirely and saves at least one memcopy for all node data.
avoid redundant memcopy in node_buffer::get_nodes
rebased. travis: https://travis-ci.org/arvidn/bootstrap-dht/builds/154209715
This comparison should be <=. No point in returning two ranges if they're going to comprise the entire buffer.
actually, changing that comparison operator made the unit test fail. I'll fix that in-place in the master branch (since I already merged it)