triez 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 331dc65dd70b83b8986fe4d07b5242e1cd8264d4
4
- data.tar.gz: 8fb8aabd4adabb3388723640b1382bd6f6accae1
3
+ metadata.gz: 1c4c1f285ee9dcd875d44fe4378366cf77dadf9c
4
+ data.tar.gz: 8b0347fc7f1c72994a4d5b71c895703e1ebbf7ff
5
5
  SHA512:
6
- metadata.gz: 5bcae2775f541197179171682c27e19e59cdedf92d46da2293b25c2150fdce768a49976479fd400cc318075630e4a191ada4a7041380c2676d6cf0a3d4d98a33
7
- data.tar.gz: 9e80343627118747019fe21c5087c979bd33149bdfbad0a056cc291a5cb63f4b3893fa915edc85574c4cfe95aefa82789d7867106208f9fa534cbe6eea7c911f
6
+ metadata.gz: d21b1590e2daf5d03bdd36b3c1115c2e6f4ab24d8cfe8dabd7ad36d961d9db162876fdd8f13184e5f79c12fad286197350e05d52e36d879b5dd033a1e3f04d47
7
+ data.tar.gz: fbca9f35f59697db205363023edc97b1a96d0b02824ec736cc84f224a4f9ec9b754f0e51fc217ad4038d7c9bb0e736c21adcfc66b4a9d958d1c756e98764cdba
data/changes CHANGED
@@ -1,3 +1,8 @@
1
+ 1.0.4
2
+
3
+ 2014-09-15
4
+ fix returning result of search_with_prefix on trie node. see https://github.com/luikore/triez/issues/3.
5
+
1
6
  1.0.3
2
7
 
3
8
  2014-09-14
@@ -127,6 +127,8 @@ static node_ptr hattrie_find(hattrie_t* T, const char **key, size_t *len, int* f
127
127
  if (!(node.t->flag & NODE_HAS_VAL)) {
128
128
  *found = 0;
129
129
  }
130
+ *key += 1;
131
+ *len -= 1;
130
132
  return node;
131
133
  }
132
134
 
@@ -1,7 +1,7 @@
1
1
  require_relative "../ext/triez"
2
2
 
3
3
  class Triez
4
- VERSION = '1.0.3'
4
+ VERSION = '1.0.4'
5
5
 
6
6
  private :_internal_set_type
7
7
  private :_internal_search
@@ -217,7 +217,9 @@ class TriezTest < Test::Unit::TestCase
217
217
  def test_should_not_segfault_when_search_with_prefix
218
218
  t = Triez.new
219
219
  # bursts when 16384
220
- 16_385.times{ |i| t["a#{i}"] = rand(10)+1 }
221
- t.search_with_prefix("a")
220
+ 16_385.times{ |i| t["a#{i}"] = i }
221
+ expected_postfices = 16_385.times.map &:to_s
222
+ actual_postfices = t.search_with_prefix("a").map(&:first)
223
+ assert_equal expected_postfices.sort, actual_postfices.sort
222
224
  end
223
225
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: triez
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zete Lui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-14 00:00:00.000000000 Z
11
+ date: 2014-09-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: fast, efficient, unicode aware HAT trie with prefix / suffix support.
14
14
  email: