summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-10-16 19:46:10 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-10-16 19:46:10 +0100
commit08733b3812fffededf4f9c997c6ba85250c70243 (patch)
treee8b46593a51fc9fa69a8fbc4a9ae8821702992d2
parentTest select nulls/optionals (diff)
downloadslicer-08733b3812fffededf4f9c997c6ba85250c70243.tar.bz2
slicer-08733b3812fffededf4f9c997c6ba85250c70243.tar.xz
slicer-08733b3812fffededf4f9c997c6ba85250c70243.zip
Do null check early, save some work
-rw-r--r--slicer/db/sqlSelectDeserializer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/slicer/db/sqlSelectDeserializer.cpp b/slicer/db/sqlSelectDeserializer.cpp
index ba5f944..5c46e11 100644
--- a/slicer/db/sqlSelectDeserializer.cpp
+++ b/slicer/db/sqlSelectDeserializer.cpp
@@ -91,12 +91,12 @@ namespace Slicer {
for (auto col = 0u; col < columnCount; col += 1) {
const DB::Column & c = cmd[col];
SqlSourcePtr h = new SqlSource(c);
- auto fmpr = rmp->GetAnonChildRef([&c](Slicer::HookCommonPtr h) {
- return boost::iequals(c.name.raw(), h->PartName());
- });
- if (fmpr) {
- auto fmp = fmpr->Child();
- if (!h->isNull()) {
+ if (!h->isNull()) {
+ auto fmpr = rmp->GetAnonChildRef([&c](Slicer::HookCommonPtr h) {
+ return boost::iequals(c.name.raw(), h->PartName());
+ });
+ if (fmpr) {
+ auto fmp = fmpr->Child();
fmp->Create();
fmp->SetValue(h);
fmp->Complete();