From 6be609dd6418f1688d027f21cfe6fdb167375bc0 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 17 May 2017 18:26:38 +0900 Subject: much better --- lib/gitlab/ci/trace/stream.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/ci/trace/stream.rb b/lib/gitlab/ci/trace/stream.rb index 3d32fae6525..5777332b251 100644 --- a/lib/gitlab/ci/trace/stream.rb +++ b/lib/gitlab/ci/trace/stream.rb @@ -92,13 +92,7 @@ module Gitlab private def read_last_lines(limit) - result = '' - reverse_line do |line| - result = line + result - limit -= 1 - return result if limit <= 0 - end - result + to_enum(:reverse_line).first(limit).reverse.join end def reverse_line -- cgit v1.2.1