@@ -247,24 +247,17 @@ def get_license_ref_uri_by_name(self, vocabulary_name):
247
247
248
248
def get_license_ref_uri_by_homepage_uri (self , vocabulary_name ):
249
249
_ , _ , license_homepage_ref_vocabulary = self ._get_license_values ()
250
- return next ((value for key , value in
251
- license_homepage_ref_vocabulary .items ()
252
- if unicode (vocabulary_name ) == key ),
253
- None )
250
+ return license_homepage_ref_vocabulary .get (unicode (vocabulary_name ))
254
251
255
252
def get_license_name_by_ref_uri (self , vocabulary_uri ):
256
253
_ , license_ref_literal_vocabulary , _ = self ._get_license_values ()
257
- return next ((value for key , value in
258
- license_ref_literal_vocabulary .items ()
259
- if unicode (vocabulary_uri ) == key ),
260
- None )
254
+ return license_ref_literal_vocabulary .get (
255
+ unicode (vocabulary_uri ))
261
256
262
257
def get_license_name_by_homepage_uri (self , vocabulary_uri ):
263
258
license_homepages_literal_vocabulary , _ , _ = self ._get_license_values ()
264
- return next ((value for key , value in
265
- license_homepages_literal_vocabulary .items ()
266
- if unicode (vocabulary_uri ) == key ),
267
- None )
259
+ return license_homepages_literal_vocabulary .get (
260
+ unicode (vocabulary_uri ))
268
261
269
262
def get_license_homepage_uri_by_name (self , vocabulary_name ):
270
263
license_homepages_literal_vocabulary , _ , _ = self ._get_license_values ()
0 commit comments