Skip to content

Commit c14fa8f

Browse files
2 parents 4236aa2 + ce70062 commit c14fa8f

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

lib/code/concerns/shared.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def code_compare(other)
208208
def code_greater(other)
209209
code_other = other.to_code
210210

211-
Object::Boolean.new((self <=> code_other) > 0)
211+
Object::Boolean.new((self <=> code_other).positive?)
212212
end
213213

214214
def code_greater_or_equal(other)
@@ -220,7 +220,7 @@ def code_greater_or_equal(other)
220220
def code_less(other)
221221
code_other = other.to_code
222222

223-
Object::Boolean.new((self <=> code_other) < 0)
223+
Object::Boolean.new((self <=> code_other).negative?)
224224
end
225225

226226
def code_less_or_equal(other)

lib/code/object/list.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -955,11 +955,10 @@ def code_sort(argument = nil, **globals)
955955
List.new(
956956
raw.sort_by.with_index do |code_element, index|
957957
if code_argument.is_a?(Function)
958-
code_argument
959-
.call(
960-
arguments: List.new([code_element, Integer.new(index), self]),
961-
**globals
962-
)
958+
code_argument.call(
959+
arguments: List.new([code_element, Integer.new(index), self]),
960+
**globals
961+
)
963962
else
964963
code_element
965964
end

0 commit comments

Comments
 (0)