anchor.diff:      // Start building the normalized component string.
       StringBuffer result;
       int length = component.length;
  -    int index = 0;
       int prevIndex = 0;
   
       // Copy a part of the component string to the result.
  
positive.code:   }
  
    static String _normalize(String component) {
      bool isNormalizedHexDigit(int digit) {
        return (_ZERO <= digit && digit <= _NINE) ||
            (_UPPER_CASE_A <= digit && digit <= _UPPER_CASE_F);
  
negative.code:     }
  
      while (index < length) {
        // Normalize percent-encoding to uppercase and don't encode
        // unreserved characters.
        assert(component.codeUnitAt(index) == _PERCENT);
        if (length < index + 2) {
            throw new ArgumentError(
                "Invalid percent-encoding in URI component: $component");
        }
  
        var codeUnit1 = component.codeUnitAt(index + 1);
        var codeUnit2 = component.codeUnitAt(index + 2);
        var decodedCodeUnit = decodeHexDigitPair(index + 1);
        if (isNormalizedHexDigit(codeUnit1) &&
            isNormalizedHexDigit(codeUnit2) &&
            !isUnreserved(decodedCodeUnit)) {
          index += 3;
        } else {
          fillResult();
          if (isUnreserved(decodedCodeUnit)) {
            result.writeCharCode(decodedCodeUnit);
          } else {
            result.write("%");
            result.writeCharCode(normalizeHexDigit(index + 1));
            result.writeCharCode(normalizeHexDigit(index + 2));
          }
          index += 3;
          prevIndex = index;
        }
        int next = component.indexOf('%', index);
        if (next >= index) {
          index = next;
        } else {
          index = length;
        }
      }
      if (result == null) return component;
  
      if (result != null && prevIndex != index) fillResult();
      assert(index == length);
  
      return result.toString();
    }
  
  