<commit_before><?php

class MonsterController extends Controller {
  protected $repo;

  public function __construct(Repositories\RepositoryInterface $repo) 
  {
    $this->repo = $repo;
  }

  function groups($id=null)
  {
    $groups = $this->repo->allObjects('MonsterGroup', 'monstergroups');
    if($id===null) {
      $id = reset($groups)->name;
      return Redirect::route("monster.groups", array($id));
    }
    $group = $this->repo->getObject('MonsterGroup', $id);
    $data = $group->uniqueMonsters;
    return View::make('monsters.groups', compact('groups', 'group', 'id', 'data'));
  }

  function species($id=null)
  {
    $species = $this->repo->all("monster.species");
    usort($species, function($a, $b) {
      return strcmp($a, $b); 
    });
    if($id===null) {
      $id = reset($species);
      return Redirect::route("monster.species", array($id));
    }
    $data = $this->repo->allObjects("Monster", "monster.species.$id");
    usort($data, function($a, $b) {
      return strcmp(strtolower($a->name), strtolower($b->name));
    });
    return View::make('monsters.species', compact('species', 'id', 'data'));
    
  }

  function view($id)
  {
    $monster = $this->repo->getObject('Monster', $id);
    return View::make('monsters.view', compact('id', 'monster'));
  }
}

<commit_msg>No need to sort monsters, it will be sorted clientside.<commit_after><?php

class MonsterController extends Controller {
  protected $repo;

  public function __construct(Repositories\RepositoryInterface $repo) 
  {
    $this->repo = $repo;
  }

  function groups($id=null)
  {
    $groups = $this->repo->allObjects('MonsterGroup', 'monstergroups');
    if($id===null) {
      $id = reset($groups)->name;
      return Redirect::route("monster.groups", array($id));
    }
    $group = $this->repo->getObject('MonsterGroup', $id);
    $data = $group->uniqueMonsters;
    return View::make('monsters.groups', compact('groups', 'group', 'id', 'data'));
  }

  function species($id=null)
  {
    $species = $this->repo->all("monster.species");
    usort($species, function($a, $b) {
      return strcmp($a, $b); 
    });
    if($id===null) {
      $id = reset($species);
      return Redirect::route("monster.species", array($id));
    }
    $data = $this->repo->allObjects("Monster", "monster.species.$id");
    return View::make('monsters.species', compact('species', 'id', 'data'));
    
  }

  function view($id)
  {
    $monster = $this->repo->getObject('Monster', $id);
    return View::make('monsters.view', compact('id', 'monster'));
  }
}


{'fraction_non_alphanumeric': 0.20430528375733856, 'fraction_numerical': 0.0, 'mean_word_length': 3.8135593220338984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '7308457', 'n_tokens_mistral': 869, 'n_tokens_neox': 838, 'n_words': 151}