lib/citeproc/ruby/sort.rb in citeproc-ruby-1.1.4 vs lib/citeproc/ruby/sort.rb in citeproc-ruby-1.1.5
- old
+ new
@@ -2,11 +2,11 @@
module Ruby
module SortItems
def sort!(items, keys)
- return itmes unless !keys.nil? && !keys.empty?
+ return items unless !keys.nil? && !keys.empty?
# TODO refactor
if items.is_a?(CitationData)
items.sort! do |a, b|
compare_items_by_keys(a.data, b.data, keys)
@@ -39,10 +39,10 @@
va, vb = a[key.variable], b[key.variable]
# Return early if one side is nil. In this
# case ascending/descending is irrelevant!
return 1 if va.nil? || va.empty?
- return -1 if vb.nil? || va.empty?
+ return -1 if vb.nil? || vb.empty?
result = case CiteProc::Variable.types[key.variable]
when :names
node = CSL::Style::Name.new(key.name_options)
node.all_names_as_sort_order!