[icinga-checkins] icinga.org: icinga2/master: Build fix for Clang.

git at icinga.org git at icinga.org
Thu Mar 14 08:18:26 CET 2013


Module: icinga2
Branch: master
Commit: 58f0c863a61d15333594339aa8f2898289a29121
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=58f0c863a61d15333594339aa8f2898289a29121

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Thu Mar 14 08:18:19 2013 +0100

Build fix for Clang.

---

 lib/icinga/timeperiod.cpp |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp
index ca245c2..a6aa91e 100644
--- a/lib/icinga/timeperiod.cpp
+++ b/lib/icinga/timeperiod.cpp
@@ -135,13 +135,14 @@ void TimePeriod::RemoveSegment(double begin, double end)
 			continue;
 		}
 
-		/* Create a new segment and adjust its begin/end timestamps
-		 * so as to not overlap with the specified range. */
-		Dictionary::Ptr newSegment = boost::make_shared<Dictionary>();
-		newSegment->Set("begin", (segment->Get("begin") < end) ? end : segment->Get("begin"));
-		newSegment->Set("end", (segment->Get("end") > begin) ? begin : segment->Get("end"));
+		/* Adjust the begin/end timestamps so as to not overlap with the specified range. */
+		if (segment->Get("begin") < end)
+			segment->Set("begin", end);
 
-		newSegments->Add(newSegment);
+		if (segment->Get("end") > begin)
+			segment->Set("end", begin);
+
+		newSegments->Add(segment);
 	}
 
 	m_Segments = newSegments;





More information about the icinga-checkins mailing list