The intent of this algorithm is that the pending source is never rejected, but including it in the record list makes it seem like it can be removed; that is only prevented by the "if selectedScopes does not contain record[0]" check.
The pending source's scopes are already included in the selected scopes set, so processing the pending source in the scopeRecords loop is redundant: The insertions will not have effect (the value is already contained), and the containment check vacuously succeeds for the same reason.
The intent of this algorithm is that the pending source is never rejected, but including it in the record list makes it seem like it can be removed; that is only prevented by the "if selectedScopes does not contain record[0]" check.
The pending source's scopes are already included in the selected scopes set, so processing the pending source in the scopeRecords loop is redundant: The insertions will not have effect (the value is already contained), and the containment check vacuously succeeds for the same reason.
Preview | Diff