[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5615] Refactor, adding one local variable and renaming an
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5615] Refactor, adding one local variable and renaming another |
Date: |
Sat, 08 Dec 2012 10:49:36 +0000 |
Revision: 5615
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5615
Author: chicares
Date: 2012-12-08 10:49:35 +0000 (Sat, 08 Dec 2012)
Log Message:
-----------
Refactor, adding one local variable and renaming another
Modified Paths:
--------------
lmi/trunk/calendar_date.cpp
Modified: lmi/trunk/calendar_date.cpp
===================================================================
--- lmi/trunk/calendar_date.cpp 2012-12-07 09:43:17 UTC (rev 5614)
+++ lmi/trunk/calendar_date.cpp 2012-12-08 10:49:35 UTC (rev 5615)
@@ -426,20 +426,17 @@
,calendar_date const& other_date
)
{
- calendar_date some_neighboring_anniversary = add_years
- (base_date
- ,other_date.year() - base_date.year()
- ,false
- );
+ int const offset = other_date.year() - base_date.year();
+ calendar_date an_adjacent_anniversary = add_years(base_date, offset,
false);
calendar_date last_anniversary =
- other_date < some_neighboring_anniversary
- ? add_years(some_neighboring_anniversary, -1, false)
- : some_neighboring_anniversary
+ other_date < an_adjacent_anniversary
+ ? add_years(an_adjacent_anniversary, -1, false)
+ : an_adjacent_anniversary
;
calendar_date next_anniversary =
- other_date < some_neighboring_anniversary
- ? some_neighboring_anniversary
- : add_years(some_neighboring_anniversary, 1, false)
+ other_date < an_adjacent_anniversary
+ ? an_adjacent_anniversary
+ : add_years(an_adjacent_anniversary, 1, false)
;
LMI_ASSERT(last_anniversary <= other_date && other_date <
next_anniversary);
LMI_ASSERT(1 == next_anniversary.year() - last_anniversary.year());
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5615] Refactor, adding one local variable and renaming another,
Greg Chicares <=