From 96077ce7e6125cdba959925d0a2b7b1f8ee54046 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Fri, 22 Nov 2013 13:32:52 +0100 Subject: Do not throw exception for normal code flow (exceptions::no_such_field). --- src/header.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/header.cpp') diff --git a/src/header.cpp b/src/header.cpp index 8e04cadc..2dc07b8f 100644 --- a/src/header.cpp +++ b/src/header.cpp @@ -171,14 +171,10 @@ shared_ptr header::findField(const string& fieldName) const // No field with this name can be found if (pos == m_fields.end()) - { - throw exceptions::no_such_field(); - } + return null; + // Else, return a reference to the existing field - else - { - return (*pos); - } + return (*pos); } -- cgit v1.2.3