GlobalInspectionContextImpl: some optimization (extract calculation from cycle)