{"action":"closed","issue":{"url":"https://api.github.com/repos/MauriceGit/skiplist/issues/3","repository_url":"https://api.github.com/repos/MauriceGit/skiplist","labels_url":"https://api.github.com/repos/MauriceGit/skiplist/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/MauriceGit/skiplist/issues/3/comments","events_url":"https://api.github.com/repos/MauriceGit/skiplist/issues/3/events","html_url":"https://github.com/MauriceGit/skiplist/issues/3","id":357481492,"node_id":"MDU6SXNzdWUzNTc0ODE0OTI=","number":3,"title":"Incorrect min. element.","user":{"login":"iwasaki-kenta","id":8392982,"node_id":"MDQ6VXNlcjgzOTI5ODI=","avatar_url":"https://avatars1.githubusercontent.com/u/8392982?v=4","gravatar_id":"","url":"https://api.github.com/users/iwasaki-kenta","html_url":"https://github.com/iwasaki-kenta","followers_url":"https://api.github.com/users/iwasaki-kenta/followers","following_url":"https://api.github.com/users/iwasaki-kenta/following{/other_user}","gists_url":"https://api.github.com/users/iwasaki-kenta/gists{/gist_id}","starred_url":"https://api.github.com/users/iwasaki-kenta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwasaki-kenta/subscriptions","organizations_url":"https://api.github.com/users/iwasaki-kenta/orgs","repos_url":"https://api.github.com/users/iwasaki-kenta/repos","events_url":"https://api.github.com/users/iwasaki-kenta/events{/privacy}","received_events_url":"https://api.github.com/users/iwasaki-kenta/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-06T03:18:51Z","updated_at":"2018-09-06T05:47:22Z","closed_at":"2018-09-06T05:47:22Z","author_association":"NONE","body":"Tried to use the library just now with string keys that should be lexicographically ordered, though noticed that the minimum value returned was incorrect.\r\n\r\nMight there be a preferred way to have arbitrary-length string keys in this case? The keys I'm looking to use are 256-bit strings, so this current solution additionally would fail for my use case.\r\n\r\nTest case:\r\n\r\n```go\r\npackage testbed\r\n\r\nimport (\r\n\t\"github.com/MauriceGit/skiplist\"\r\n\t\"math/big\"\r\n\t\"testing\"\r\n\t\"fmt\"\r\n)\r\n\r\ntype WrappedString struct {\r\n\tId string\r\n}\r\n\r\nfunc (w WrappedString) ExtractKey() float64 {\r\n\tnum := new(big.Int)\r\n\tnum.SetBytes([]byte(w.Id))\r\n\r\n\tfmt.Println(w.Id, \" \", float64(num.Uint64()))\r\n\r\n\treturn float64(num.Uint64())\r\n}\r\n\r\nfunc (w WrappedString) String() string {\r\n\treturn w.Id\r\n}\r\n\r\nfunc TestSkiplist(t *testing.T) {\r\n\tlist := new(skiplist.SkipList)\r\n\r\n\tids := []string{\"a\", \"b\", \"c\", \"d\"}\r\n\r\n\tfor _, id := range ids {\r\n\t\tlist.Insert(WrappedString{Id: id})\r\n\t}\r\n\r\n\tt.Log(\"min: \", list.GetSmallestNode().GetValue())\r\n\tt.Log(\"max: \", list.GetLargestNode().GetValue())\r\n}\r\n```\r\n\r\nLog:\r\n\r\n```bash\r\n=== RUN   TestSkiplist\r\na   97\r\nb   98\r\nc   99\r\nd   100\r\n--- PASS: TestSkiplist (0.00s)\r\n    skiplist_test.go:36: min:  b\r\n    skiplist_test.go:37: max:  d\r\nPASS\r\nok      github.com/iwasaki-kenta/testbed/inmem 0.002s\r\n```"}}
{"actor":{"display_login":"MauriceGit"}}