From e5c9c0dd9ff1f42dcdaba7a51919cf43abdb79f9 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 21 Jul 2019 06:24:22 +0200 Subject: *: avoid unnecessary conversions No need to convert these values, they're already of the right type. Signed-off-by: Christian Muehlhaeuser (cherry picked from commit a1d8a7ac8bd0e4aff0f27dbb8bb37b8bd13a1346) --- utils/merkletrie/difftree_test.go | 2 +- utils/merkletrie/noder/path_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'utils') diff --git a/utils/merkletrie/difftree_test.go b/utils/merkletrie/difftree_test.go index ac86145..f725bcf 100644 --- a/utils/merkletrie/difftree_test.go +++ b/utils/merkletrie/difftree_test.go @@ -177,7 +177,7 @@ func newChangesFromString(s string) (changes, error) { for _, chunk := range strings.Split(s, " ") { change := change{ - path: string(chunk[1:]), + path: chunk[1:], } switch chunk[0] { diff --git a/utils/merkletrie/noder/path_test.go b/utils/merkletrie/noder/path_test.go index f49f028..f65b1d5 100644 --- a/utils/merkletrie/noder/path_test.go +++ b/utils/merkletrie/noder/path_test.go @@ -154,8 +154,8 @@ func (s *PathSuite) TestCompareMixedDepths(c *C) { } func (s *PathSuite) TestCompareNormalization(c *C) { - p1 := Path([]Noder{&noderMock{name: norm.Form(norm.NFKC).String("페")}}) - p2 := Path([]Noder{&noderMock{name: norm.Form(norm.NFKD).String("페")}}) + p1 := Path([]Noder{&noderMock{name: norm.NFKC.String("페")}}) + p2 := Path([]Noder{&noderMock{name: norm.NFKD.String("페")}}) c.Assert(p1.Compare(p2), Equals, 1) c.Assert(p2.Compare(p1), Equals, -1) p1 = Path([]Noder{&noderMock{name: "TestAppWithUnicodéPath"}}) -- cgit