mirror of
https://github.com/gbevin/urlencoder.git
synced 2025-04-25 23:37:12 -07:00
Code cleanups
This commit is contained in:
parent
fc251e2073
commit
3208aa4cca
1 changed files with 6 additions and 1 deletions
|
@ -32,6 +32,10 @@ public abstract class UrlEncoder {
|
||||||
UNRESERVED_URI_CHARS = unreserved;
|
UNRESERVED_URI_CHARS = unreserved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private UrlEncoder() {
|
||||||
|
throw new IllegalStateException("UrlEncoder shouldn't be instantiated");
|
||||||
|
}
|
||||||
|
|
||||||
private static void appendUrlEncodedByte(StringBuilder out, int ch) {
|
private static void appendUrlEncodedByte(StringBuilder out, int ch) {
|
||||||
out.append("%");
|
out.append("%");
|
||||||
appendUrlEncodedDigit(out, ch >> 4);
|
appendUrlEncodedDigit(out, ch >> 4);
|
||||||
|
@ -155,7 +159,8 @@ public abstract class UrlEncoder {
|
||||||
|
|
||||||
StringBuilder out = null;
|
StringBuilder out = null;
|
||||||
char ch;
|
char ch;
|
||||||
for (var i = 0; i < source.length(); ) {
|
var i = 0;
|
||||||
|
while(i < source.length()) {
|
||||||
ch = source.charAt(i);
|
ch = source.charAt(i);
|
||||||
if (isUnreservedUriChar(ch) || allow.indexOf(ch) != -1) {
|
if (isUnreservedUriChar(ch) || allow.indexOf(ch) != -1) {
|
||||||
if (out != null) {
|
if (out != null) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue