From 068a2868ae8d5316a7c4cf9a3d1452dfab8e43a5 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Wed, 18 Jun 2025 02:46:27 +0000 Subject: Fix RuboCop Lint/AmbiguousRange (#41884). git-svn-id: https://svn.redmine.org/redmine/trunk@23842 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/diff.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib/redmine') 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 << '' + CGI.escapeHTML(line[offsets.first..offsets.last]) + '' - 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) -- cgit v1.2.3