From 4517f40f57df6ee5ef339d21b135ba4b79ffa4e9 Mon Sep 17 00:00:00 2001 From: www Date: Sun, 24 Mar 2019 18:57:06 +0800 Subject: [PATCH] Remove redundant 'String.substring()' call --- .../springframework/web/util/HtmlCharacterEntityDecoder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/util/HtmlCharacterEntityDecoder.java b/spring-web/src/main/java/org/springframework/web/util/HtmlCharacterEntityDecoder.java index 54bca57f3d8..2277edfff3a 100644 --- a/spring-web/src/main/java/org/springframework/web/util/HtmlCharacterEntityDecoder.java +++ b/spring-web/src/main/java/org/springframework/web/util/HtmlCharacterEntityDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 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. @@ -95,7 +95,7 @@ class HtmlCharacterEntityDecoder { int skipUntilIndex = (this.nextPotentialReferencePosition != -1 ? this.nextPotentialReferencePosition : this.originalMessage.length()); if (skipUntilIndex - this.currentPosition > 3) { - this.decodedMessage.append(this.originalMessage.substring(this.currentPosition, skipUntilIndex)); + this.decodedMessage.append(this.originalMessage, this.currentPosition, skipUntilIndex); this.currentPosition = skipUntilIndex; } else {