[esnacc-dev] cxx-lib/asn-buf: fix a large parameter pass-by-value

Message ID 20180115204233.11758-1-aconole@bytheb.org
State Accepted
Delegated to: Aaron Conole
Headers show

Commit Message

Aaron Conole Jan. 15, 2018, 8:42 p.m.
The BufferException object is quite large (>512 bytes), which incurrs
a performance impact.  Convert the pass-by-value to a
pass-by-reference.

Fixes: ea172d558054 ("cxx-lib/src/asn-buf: make GetSeg non-throwing.")
Signed-off-by: Aaron Conole <aconole@bytheb.org>
---
 cxx-lib/src/asn-buf.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/cxx-lib/src/asn-buf.cpp b/cxx-lib/src/asn-buf.cpp
index c599182..2591bec 100644
--- a/cxx-lib/src/asn-buf.cpp
+++ b/cxx-lib/src/asn-buf.cpp
@@ -208,7 +208,7 @@  char * AsnBuf::GetSeg(long segLen) const
 
     try {
         GetSeg(seg, segLen);
-    } catch (BufferException) {
+    } catch (BufferException &) {
         delete [] seg;
         seg = NULL;
     }