Skip to content

Commit

Permalink
remove unncessary if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Feb 20, 2016
1 parent 8ee38f6 commit 6653bcb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/galaxy/model/__init__.py
Expand Up @@ -113,18 +113,13 @@ def _init_metrics( self ):
self.numeric_metrics = []

def add_metric( self, plugin, metric_name, metric_value ):
if isinstance( plugin, string_types ):
plugin = unicodify( plugin, 'utf-8' )

if isinstance( metric_name, string_types ):
metric_name = unicodify( metric_name, 'utf-8' )

plugin = unicodify( plugin, 'utf-8' )
metric_name = unicodify( metric_name, 'utf-8' )
if isinstance( metric_value, numbers.Number ):
metric = self._numeric_metric( plugin, metric_name, metric_value )
self.numeric_metrics.append( metric )
else:
if isinstance( metric_value, string_types ):
metric_value = unicodify( metric_value, 'utf-8' )
metric_value = unicodify( metric_value, 'utf-8' )
if len( metric_value ) > 1022:
# Truncate these values - not needed with sqlite
# but other backends must need it.
Expand Down

0 comments on commit 6653bcb

Please sign in to comment.