Cache `this._segments.length` in a variable to avoid re-accessing it on every iteration.