Commit 43bfc27017d1167cb8ae1bf72eaa7d4f1e9dc912

Authored by Josh Cardenzana
Committed by Jürgen Knödlseder
1 parent 872648a0

Apply some minor speed ups preventing initializing GGti objects (#2713)

Showing 1 changed file with 2 additions and 3 deletions
src/ctfindvar/ctfindvar.cpp
@@ -510,7 +510,7 @@ void ctfindvar::fill_alpha_vector(const int& pix_number, @@ -510,7 +510,7 @@ void ctfindvar::fill_alpha_vector(const int& pix_number,
510 GCTAInstDir instdir = obs->pointing().instdir(pix_dir); 510 GCTAInstDir instdir = obs->pointing().instdir(pix_dir);
511 511
512 // Extract the good time intervals of the observation 512 // Extract the good time intervals of the observation
513 - GGti obs_gti = obs->gti(); 513 + const GGti& obs_gti(obs->gti());
514 514
515 // Loop over all time bins 515 // Loop over all time bins
516 for (int j=0; j<m_gti.size(); j++) { 516 for (int j=0; j<m_gti.size(); j++) {
@@ -572,8 +572,7 @@ int ctfindvar::time2inx(const GTime&amp; time) @@ -572,8 +572,7 @@ int ctfindvar::time2inx(const GTime&amp; time)
572 // Loop over all GTIs 572 // Loop over all GTIs
573 for (int i=0; i<m_gti.size(); i++) { 573 for (int i=0; i<m_gti.size(); i++) {
574 // Check if interval contains the time 574 // Check if interval contains the time
575 - GGti interval = inx2gti(i);  
576 - if (interval.contains(time)) { 575 + if (m_gti.tstart(i) < time && m_gti.tstop(i) > time) {
577 map_index = i; 576 map_index = i;
578 break; 577 break;
579 } 578 }