Simplify term selection.

This commit is contained in:
Dave Longley 2013-04-03 14:20:25 -04:00
parent fe09299b21
commit e19abc3ff4

View file

@ -3301,7 +3301,7 @@ class JsonLdProcessor {
array('propertyIsArray' => true, 'allowDuplicate' => false)); array('propertyIsArray' => true, 'allowDuplicate' => false));
$this->_createNodeMap($o, $graphs, $graph, $namer, $id, null); $this->_createNodeMap($o, $graphs, $graph, $namer, $id, null);
} }
// handle $list // handle @list
else if(self::_isList($o)) { else if(self::_isList($o)) {
$_list = new ArrayObject(); $_list = new ArrayObject();
$this->_createNodeMap( $this->_createNodeMap(
@ -4036,13 +4036,8 @@ class JsonLdProcessor {
} }
$prefs[] = '@none'; $prefs[] = '@none';
$term = null;
$container_map = $active_ctx->inverse->{$iri}; $container_map = $active_ctx->inverse->{$iri};
foreach($containers as $container) { foreach($containers as $container) {
if($term !== null) {
break;
}
// if container not available in the map, continue // if container not available in the map, continue
if(!property_exists($container_map, $container)) { if(!property_exists($container_map, $container)) {
continue; continue;
@ -4057,11 +4052,10 @@ class JsonLdProcessor {
} }
// select term // select term
$term = $type_or_language_value_map->{$pref}; return $type_or_language_value_map->{$pref};
break;
} }
} }
return $term; return null;
} }
/** /**