From 5d04457ddb8c9d412565d0a03fe422736cdaa51d Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Wed, 13 May 2020 07:46:06 -0500 Subject: [PATCH] Dead code removal and other cleanups --- lib/pigeon.rb | 6 ------ lib/pigeon/message.rb | 3 --- lib/pigeon/storage.rb | 8 -------- 3 files changed, 17 deletions(-) diff --git a/lib/pigeon.rb b/lib/pigeon.rb index 2a052a2..0236a37 100644 --- a/lib/pigeon.rb +++ b/lib/pigeon.rb @@ -266,12 +266,6 @@ module Pigeon return b32_decode(string[1..].gsub(FOOTERS_REGEX, "")) end end - - def self.blob_multihash?(unknown) - (unknown.is_a?(String) && - unknown.length == 60 && - (unknown[0] == BLOB_SIGIL)) - end end end diff --git a/lib/pigeon/message.rb b/lib/pigeon/message.rb index 8324fd9..111f755 100644 --- a/lib/pigeon/message.rb +++ b/lib/pigeon/message.rb @@ -29,9 +29,6 @@ module Pigeon @depth = depth @kind = kind @prev = prev || Pigeon::NOTHING - unless lipmaa.is_a?(String) - raise "Bad lipmaa value: #{lipmaa}" - end @lipmaa = lipmaa @signature = signature end diff --git a/lib/pigeon/storage.rb b/lib/pigeon/storage.rb index 7886c17..28ac3fb 100644 --- a/lib/pigeon/storage.rb +++ b/lib/pigeon/storage.rb @@ -73,10 +73,6 @@ module Pigeon # `nil` means "none" def get_message_count_for(mhash) - unless mhash.is_a?(String) - raise "Expected string, got #{mhash.class}" - end # Delete later - read { store[COUNT_INDEX_NS][mhash] || 0 } end @@ -97,10 +93,6 @@ module Pigeon end def get_message_by_depth(multihash, depth) - unless multihash.is_a?(String) - raise "Expected string, got #{multihash.class}" - end # Delete later - # Map<[multihash(str), depth(int)], Signature> key = [multihash, depth].join(".") read { store[MESSAGE_BY_DEPTH_NS][key] }