summaryrefslogtreecommitdiffstats
path: root/lib/redmine
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2025-06-18 02:46:27 +0000
committerGo MAEDA <maeda@farend.jp>2025-06-18 02:46:27 +0000
commit068a2868ae8d5316a7c4cf9a3d1452dfab8e43a5 (patch)
tree8d4035017dde42510a9ddbc21a2e3cefb8c23058 /lib/redmine
parenta4a32179f6d530c52d32bece5d2f6b165129179c (diff)
downloadredmine-master.tar.gz
redmine-master.zip
Fix RuboCop Lint/AmbiguousRange (#41884).HEADmaster
git-svn-id: https://svn.redmine.org/redmine/trunk@23842 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r--lib/redmine/diff.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/redmine/diff.rb b/lib/redmine/diff.rb
index 40c444a42..c925d463a 100644
--- a/lib/redmine/diff.rb
+++ b/lib/redmine/diff.rb
@@ -76,13 +76,9 @@ module Redmine
def line_to_html_raw(line, offsets)
if offsets
s = +''
- unless offsets.first == 0
- s << CGI.escapeHTML(line[0..offsets.first-1])
- end
+ s << CGI.escapeHTML(line[0..(offsets.first - 1)]) unless offsets.first == 0
s << '<span>' + CGI.escapeHTML(line[offsets.first..offsets.last]) + '</span>'
- unless offsets.last == -1
- s << CGI.escapeHTML(line[offsets.last+1..-1])
- end
+ s << CGI.escapeHTML(line[(offsets.last + 1)..-1]) unless offsets.last == -1
s
else
CGI.escapeHTML(line)