From: Toshi MARUYAMA Date: Tue, 22 Oct 2019 15:54:59 +0000 (+0000) Subject: code cleanup: rubocop: fix Style/ParenthesesAroundCondition in lib/diff.rb X-Git-Tag: 4.1.0~267 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5ac2471a7af987a430cce8eae36ada30524e6320;p=redmine.git code cleanup: rubocop: fix Style/ParenthesesAroundCondition in lib/diff.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18836 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c25f0ffce..c9b921590 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1144,7 +1144,6 @@ Style/ParallelAssignment: Style/ParenthesesAroundCondition: Exclude: - 'app/models/repository/subversion.rb' - - 'lib/diff.rb' - 'lib/redmine/helpers/gantt.rb' - 'lib/redmine/scm/adapters/cvs_adapter.rb' - 'lib/redmine/scm/adapters/git_adapter.rb' diff --git a/lib/diff.rb b/lib/diff.rb index 5c6eb4380..ca451ddf0 100644 --- a/lib/diff.rb +++ b/lib/diff.rb @@ -13,14 +13,14 @@ module RedmineDiff mvector = [] # First we prune off any common elements at the beginning - while (astart <= afinish && bstart <= afinish && a[astart] == b[bstart]) + while (astart <= afinish) && (bstart <= afinish) && (a[astart] == b[bstart]) mvector[astart] = bstart astart += 1 bstart += 1 end # now the end - while (astart <= afinish && bstart <= bfinish && a[afinish] == b[bfinish]) + while (astart <= afinish) && (bstart <= bfinish) && (a[afinish] == b[bfinish]) mvector[afinish] = bfinish afinish -= 1 bfinish -= 1