Skip to content

Commit b3b4b1c

Browse files
turbanoffaivanov-jdk
authored andcommitted
8273907: Cleanup redundant Math.max/min calls in DefaultHighlighter
Reviewed-by: pbansal, aivanov, azvegint
1 parent a67f0f9 commit b3b4b1c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/java.desktop/share/classes/javax/swing/text/DefaultHighlighter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
3939
public class DefaultHighlighter extends LayeredHighlighter {
4040

4141
/**
42-
* Creates a new DefaultHighlighther object.
42+
* Creates a new DefaultHighlighter object.
4343
*/
4444
public DefaultHighlighter() {
4545
drawsLayeredHighlights = true;
@@ -244,7 +244,7 @@ public void changeHighlight(Object tag, int p0, int p1) throws BadLocationExcept
244244
lhi.width = lhi.height = 0;
245245
lhi.p0 = doc.createPosition(p0);
246246
lhi.p1 = doc.createPosition(p1);
247-
safeDamageRange(Math.min(p0, p1), Math.max(p0, p1));
247+
safeDamageRange(p0, p1);
248248
}
249249
else {
250250
HighlightInfo info = (HighlightInfo) tag;

0 commit comments

Comments
 (0)