ANNIEsoft / ToolAnalysis

Other
10 stars 53 forks source link

Unreachable branch; LoadRawData.cpp #238

Closed s4294967296 closed 1 year ago

s4294967296 commented 1 year ago

The last else branch cannot be reached, I am unsure what the desired functionality should be in the context of the tool.

    ...
    else if (!readtrigoverlap) {
      ...
    } else if (readtrigoverlap){
      ...
    } else {
        ...
    }

https://github.com/ANNIEsoft/ToolAnalysis/blob/64a58c8ed5f5b80f721a8a295965aae9ab2e7249/UserTools/LoadRawData/LoadRawData.cpp#L580-L611

mnieslony commented 1 year ago

Hi @s4294967296, so the structure inside the last else if (readtrigoverlap) is first another if condition before the else condition. So both the last if and else condition are inside the else if (readtrigoverlap) block and should hence be reachable.

Structure should be the following: else if (!readtrigoverlap) { ... } else if (readtrigoverlap){ ... if (TrigEntryNum != trigtotalentries-1){ .... } else { ... } }