From e19abc3ff4a6c8c3f789a7867a07c986be5c5165 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Wed, 3 Apr 2013 14:20:25 -0400 Subject: [PATCH] Simplify term selection. --- jsonld.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/jsonld.php b/jsonld.php index 9316eff..ee93f62 100644 --- a/jsonld.php +++ b/jsonld.php @@ -3301,7 +3301,7 @@ class JsonLdProcessor { array('propertyIsArray' => true, 'allowDuplicate' => false)); $this->_createNodeMap($o, $graphs, $graph, $namer, $id, null); } - // handle $list + // handle @list else if(self::_isList($o)) { $_list = new ArrayObject(); $this->_createNodeMap( @@ -4036,13 +4036,8 @@ class JsonLdProcessor { } $prefs[] = '@none'; - $term = null; $container_map = $active_ctx->inverse->{$iri}; foreach($containers as $container) { - if($term !== null) { - break; - } - // if container not available in the map, continue if(!property_exists($container_map, $container)) { continue; @@ -4057,11 +4052,10 @@ class JsonLdProcessor { } // select term - $term = $type_or_language_value_map->{$pref}; - break; + return $type_or_language_value_map->{$pref}; } } - return $term; + return null; } /**