openhab-scripters/openhab-helper-libraries

core.metadata get_metadata duplicate lines of code

jimtng opened this issue · 2 comments

In https://github.com/openhab-scripters/openhab-helper-libraries/blob/master/Core/automation/lib/python/core/metadata.py the function get_metadata line 71-72,

    metadata = metadata_registry.get(MetadataKey(namespace, item_name))
    return metadata_registry.get(MetadataKey(namespace, item_name))

Why the duplication?

5iver commented

Thank you for pointing this out. Take a look here...

dca5e5d#r39583902

I'd removed some unnecessary commented out code in the last commit to core.metadata.py and this line should have been removed too. This wouldn't break anything, but there is no need to call the MetadataRegistry twice. I committed this change a long while ago and it will be included in a PR later this week. I have a lot to get pushed!

5iver commented

I squeaked this into #327.