summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-11-05 19:29:25 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2019-11-05 19:29:25 -0800
commit145bc8d50415c5f01cdb0cb5685eea0a7738b7ea (patch)
tree923ff8900977193e0f5be293f6b3be05b2ef46c4
parent72352921c1b03957fdf39794737f45c88a9346ba (diff)
downloadchef-145bc8d50415c5f01cdb0cb5685eea0a7738b7ea.tar.gz
Remove useless search arg mangling
This doesn't actually do anything and repetitively confuses me every 6 months when I look at it. Array#pop(0) does nothing at all (in python it removes the first element from the list): [2] pry(main)> a = [ 1, 2, 3 ] => [1, 2, 3] [3] pry(main)> a.pop(0) => [] [4] pry(main)> a => [1, 2, 3] Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/search/query.rb3
1 files changed, 0 insertions, 3 deletions
diff --git a/lib/chef/search/query.rb b/lib/chef/search/query.rb
index 5a9c1f6d41..46dedd33f8 100644
--- a/lib/chef/search/query.rb
+++ b/lib/chef/search/query.rb
@@ -126,9 +126,6 @@ class Chef
return args.first if args.first.is_a?(Hash)
args_h = {}
- # If we have 4 arguments, the first is the now-removed sort option, so
- # just ignore it.
- args.pop(0) if args.length == 4
args_h[:start] = args[0] if args[0]
args_h[:rows] = args[1]
args_h[:filter_result] = args[2]