Skip to content

Commit

Permalink
Fixed a bug when looking for fields by their name
Browse files Browse the repository at this point in the history
  • Loading branch information
drslump committed Jul 7, 2011
1 parent 209f19a commit 9d4a0f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/DrSlump/Protobuf/Descriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public function getFieldByName($name)

// Loop thru all fields to find it
foreach ($this->fields as $tag=>$field) {
// Build the cache map
$this->names[$name] = $tag;
if ($name === $field->getName()) {
// Cache it for next calls
$this->names[$name] = $tag;
return $field;
}
}
Expand Down

0 comments on commit 9d4a0f3

Please sign in to comment.