Optimization for duplicated repeat operators