<commit_before>#encoding: UTF-8
class MaiorPreco
  def encontra carrinho
    return 0 if carrinho.itens.empty?
    return carrinho.itens[0].valor_total
  end
end<commit_msg>Passando teste iterando pelos itens<commit_after>#encoding: UTF-8
class MaiorPreco
  def encontra carrinho
    return 0 if carrinho.itens.empty?

    maior = carrinho.itens[0].valor_total
    carrinho.itens.each do |item|
      if maior < item.valor_total
        maior = item.valor_total
      end
    end
    maior
  end
end
{'fraction_non_alphanumeric': 0.07014028056112225, 'fraction_numerical': 0.012024048096192385, 'mean_word_length': 3.23728813559322, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2117015', 'n_tokens_mistral': 192, 'n_tokens_neox': 186, 'n_words': 44}