Skip to content

Commit

Permalink
Refactor and fix EdgeSet#find
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdabbs committed Apr 11, 2013
1 parent 00cc294 commit dcc10a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/steffi/edge_set.rb
Expand Up @@ -34,8 +34,9 @@ def each
end

def find pair, error=false
id = FFI::MemoryPointer.new :int
Igraph.get_eid @graph.pointer, id, pair.first, pair.last, @graph.directed?, error
FFI::MemoryPointer.new(:int).tap do |id|
Igraph.get_eid @graph.pointer, id, pair.first, pair.last, @graph.directed?, error
end.get_int 0
end

def find_pairs *pairs
Expand Down

0 comments on commit dcc10a6

Please sign in to comment.