Skip to content

Commit

Permalink
Remove unnecessary patp2bn
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-levan committed Nov 22, 2024
1 parent 0ea36cf commit c8f2080
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/aura/p.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,15 @@ def self.patp2hex(name)
hex.length.odd? ? "0x#{hex.rjust(hex.length + 1, "0")}" : "0x#{hex}"
end

def self.patp2bn(name)
"0x#{patp2hex(name)}".to_i(16)
end

def self.patp2dec(name)
patp2bn(name).to_s
patp2hex(name).to_i(16)
rescue ArgumentError
raise "patp2dec: not a valid @p"
end

def self.clan(who)
begin
name = patp2bn(who)
name = patp2hex(who)
rescue ArgumentError
raise "clan: not a valid @p"
end
Expand All @@ -57,7 +53,7 @@ def self.clan(who)

def self.sein(name)
begin
who = patp2bn(name)
who = patp2hex(name)
mir = clan(name)
rescue ArgumentError
raise "sein: not a valid @p"
Expand Down

0 comments on commit c8f2080

Please sign in to comment.