diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-08-22 21:02:52 -0700 |
---|---|---|
committer | Rebecca Turner <rbt@sent.as> | 2024-08-28 09:52:05 -0700 |
commit | 4d8984420788d6253d2fd9bfa3ada92be8bfd73b (patch) | |
tree | d5db726ff1b87672c01f04e27064d5188d27d45a /src/libutil/serialise.hh | |
parent | 422550fd68a5877534b1ca577fc3c7d89b6706dd (diff) |
build: remove about 30 cpu-sec of compile time by explicit instantiation
Apparently the fmt contraption has some extremely popular overloads, and
the boost stuff in there gets built approximately infinite times in
every compilation unit.
Change-Id: Ideba2db7d6bf8559e4d91974bab636f5ed106198
Diffstat (limited to 'src/libutil/serialise.hh')
-rw-r--r-- | src/libutil/serialise.hh | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh index d6a22b3e9..9ad8018d0 100644 --- a/src/libutil/serialise.hh +++ b/src/libutil/serialise.hh @@ -450,19 +450,7 @@ inline Sink & operator<<(Sink & sink, const Error & ex) MakeError(SerialisationError, Error); template<typename T> -T readNum(Source & source) -{ - unsigned char buf[8]; - source(charptr_cast<char *>(buf), sizeof(buf)); - - auto n = readLittleEndian<uint64_t>(buf); - - if (n > (uint64_t) std::numeric_limits<T>::max()) - throw SerialisationError("serialised integer %d is too large for type '%s'", n, typeid(T).name()); - - return (T) n; -} - +T readNum(Source & source); inline unsigned int readInt(Source & source) { |