diff options
author | Connor Shea <connor.james.shea@gmail.com> | 2016-04-28 01:52:32 +0300 |
---|---|---|
committer | Connor Shea <connor.james.shea@gmail.com> | 2016-05-11 03:23:25 +0300 |
commit | 377583a361988d9884808a3c3f5375497a9d5b56 (patch) | |
tree | 0606e242db6a23bb7bc643eab841c9eb89f217e2 /lib/gitlab/markup_helper.rb | |
parent | 4a47470febe34bf67e84a2904422626caa64224e (diff) |
Enable Rubocop Casecmp Performance Cop.
Also fixes the errors caused by enabling the cop. casecmp is more performant than `.downcase` and `==`.
Diffstat (limited to 'lib/gitlab/markup_helper.rb')
-rw-r--r-- | lib/gitlab/markup_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/markup_helper.rb b/lib/gitlab/markup_helper.rb index a5f767b134d..dda371e6554 100644 --- a/lib/gitlab/markup_helper.rb +++ b/lib/gitlab/markup_helper.rb @@ -40,7 +40,7 @@ module Gitlab # Returns boolean def plain?(filename) filename.downcase.end_with?('.txt') || - filename.downcase == 'readme' + filename.casecmp('readme').zero? end def previewable?(filename) |