9 Commits

Author SHA1 Message Date
Hector Sanjuan
0aa80854ab Let Multiaddr implement marshalers: binary, text, json 2019-02-25 22:48:24 +00:00
Steven Allen
877fe6538c shortcut split on components
Instead of re-parsing single-components, shortcut split/for-each functions.
2018-10-18 10:32:13 +01:00
Steven Allen
c8d6befb43 add more split tools and a bunch of tests 2018-10-02 14:26:34 -07:00
Steven Allen
58bcbc8e51 add component/foreach helpers
This adds a `Component` helper type and a `ForEach` helper method.

The first attempt used an interface but interfaces imply allocation. We really
can't afford to allocate here.
2018-10-01 21:18:11 -07:00
Steven Allen
2e9c819c18 make cast use NewMultiaddrBytes
This will perform all the correct checks *except* that it won't bother actually
stringifying the multiaddr. It should be significantly faster.
2018-10-01 16:57:15 -07:00
Steven Allen
2999d4efba small Join optimizations 2018-10-01 16:56:58 -07:00
Steven Allen
61e31ed48b stop copying when calling Bytes
This is a huge performance hit. Really, we just need to tell users not to modify
the result.

Also, get rid of an unnecessary pointer indirection (no api change).
2018-10-01 16:56:57 -07:00
Juan Batiz-Benet
62a88e015e faster encapsulation + join 2014-11-05 02:30:53 -08:00
Juan Batiz-Benet
9d04132166 Split + Join 2014-11-05 02:20:27 -08:00