From a38dfa370aa0a18aaba38b3677c6fd4c86a9e6ad Mon Sep 17 00:00:00 2001 From: oysheng Date: Sun, 22 Apr 2018 17:20:35 +0800 Subject: [PATCH] optimise --- asset/asset.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asset/asset.go b/asset/asset.go index b8e9d5e5..a191a93b 100644 --- a/asset/asset.go +++ b/asset/asset.go @@ -304,11 +304,11 @@ func (reg *Registry) ListAssets(id string) ([]*Asset, error) { assets := []*Asset{DefaultNativeAsset} assetIDStr := strings.TrimSpace(id) - if strings.Compare(assetIDStr, DefaultNativeAsset.AssetID.String()) == 0 { + if assetIDStr == DefaultNativeAsset.AssetID.String() { return assets, nil } - if strings.Compare(assetIDStr, "") != 0 { + if assetIDStr == "" { assetID := &bc.AssetID{} if err := assetID.UnmarshalText([]byte(assetIDStr)); err != nil { return nil, err -- 2.11.0