Skip to content

Commit 6c441e9

Browse files
Resolve merge conflict and validate boundaries
Clean up merge conflict in src/solar_zodiac.cpp: remove duplicated code, add a check that build_boundaries produced at least two entries (throwing a runtime_error if not), and use the JD_EPSILON constant for the in-year interval comparison instead of a hardcoded 1e-12. This prevents processing with insufficient boundary data and standardizes the epsilon usage.
1 parent 7708211 commit 6c441e9

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/solar_zodiac.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ SolarZodiacYearSummary calc_solar_zodiac_year(EphRead&eph,int year,int tz_off){
153153

154154
std::vector<SolarZodiacBoundary> boundaries=
155155
build_boundaries(eph,year-1,year+1);
156-
<<<<<<< Updated upstream
156+
if(boundaries.size()<2){
157+
throw std::runtime_error("failed to build solar zodiac boundaries");
158+
}
159+
157160
for(std::size_t i=0;i+1<boundaries.size();++i){
158161
const SolarZodiacBoundary&cur=boundaries[i];
159162
const SolarZodiacBoundary&next=boundaries[i+1];
@@ -167,18 +170,6 @@ SolarZodiacYearSummary calc_solar_zodiac_year(EphRead&eph,int year,int tz_off){
167170
double in_year_start=std::max(cur.jd_utc,out.year_start_jd_utc);
168171
double in_year_end=std::min(next.jd_utc,out.year_end_jd_utc);
169172
if(in_year_end-in_year_start<=JD_EPSILON){
170-
=======
171-
if(boundaries.size()<2){
172-
throw std::runtime_error("failed to build solar zodiac boundaries");
173-
}
174-
175-
for(std::size_t i=0;i+1<boundaries.size();++i){
176-
const SolarZodiacBoundary&cur=boundaries[i];
177-
const SolarZodiacBoundary&next=boundaries[i+1];
178-
double in_year_start=std::max(cur.jd_utc,out.year_start_jd_utc);
179-
double in_year_end=std::min(next.jd_utc,out.year_end_jd_utc);
180-
if(in_year_end-in_year_start<=1e-12){
181-
>>>>>>> Stashed changes
182173
continue;
183174
}
184175

0 commit comments

Comments
 (0)