From fdc17bea58f210f62ac0d9e836b68e84c6dbd15c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 15 Nov 2016 16:56:29 +0100 Subject: Fix rubocop issues, introduce usage of frozen literal to improve performance --- app/controllers/api_controller.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app/controllers/api_controller.rb') diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index ef453799b..aafaf843c 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApiController < ApplicationController DEFAULT_STATUSES_LIMIT = 20 DEFAULT_ACCOUNTS_LIMIT = 40 @@ -51,8 +53,8 @@ class ApiController < ApplicationController def set_pagination_headers(next_path = nil, prev_path = nil) links = [] - links << [next_path, [['rel', 'next']]] if next_path - links << [prev_path, [['rel', 'prev']]] if prev_path + links << [next_path, [%w(rel next)]] if next_path + links << [prev_path, [%w(rel prev)]] if prev_path response.headers['Link'] = LinkHeader.new(links) end @@ -76,7 +78,7 @@ class ApiController < ApplicationController render json: {}, status: 200 end - def set_maps(statuses) + def set_maps(statuses) # rubocop:disable Style/AccessorMethodName if current_account.nil? @reblogs_map = {} @favourites_map = {} -- cgit