From 7c01f0c927bae4db4a8845481cd4903622a40c5f Mon Sep 17 00:00:00 2001 From: Samuel Jackson Date: Tue, 17 Sep 2013 09:29:26 +0100 Subject: [PATCH] Refs #7807 Fix for failing unit test --- Code/Mantid/Framework/Kernel/inc/MantidKernel/DataService.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/DataService.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/DataService.h index 89571b56821b..33457ae7a69f 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/DataService.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/DataService.h @@ -300,7 +300,8 @@ class DLLExport DataService // if there is another object which has newName delete it // this is actually a replace operation, so we send out there notifications as well. it = datamap.find( newName ); - if ( it != datamap.end() ) + bool replace = (it != datamap.end()); + if ( replace ) { notificationCenter.postNotification(new BeforeReplaceNotification(newName, it->second, object)); @@ -319,7 +320,7 @@ class DLLExport DataService } //if we're replacing, send out the post replace notification - if(it != datamap.end()) + if( replace ) { notificationCenter.postNotification(new AfterReplaceNotification(newName,object)); }