Remove no-op code in URI encoding

Closes gh-24413
This commit is contained in:
Rossen Stoyanchev 2020-01-24 15:36:46 +00:00
parent ab70acb325
commit b142f8e660
1 changed files with 1 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -337,9 +337,6 @@ final class HierarchicalUriComponents extends UriComponents {
byte[] bytes = source.getBytes(charset);
boolean original = true;
for (byte b : bytes) {
if (b < 0) {
b += 256;
}
if (!type.isAllowed(b)) {
original = false;
break;
@ -351,9 +348,6 @@ final class HierarchicalUriComponents extends UriComponents {
ByteArrayOutputStream bos = new ByteArrayOutputStream(bytes.length);
for (byte b : bytes) {
if (b < 0) {
b += 256;
}
if (type.isAllowed(b)) {
bos.write(b);
}