Skip to content

Commit

Permalink
Do call next on cursor...please
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusmelke committed Feb 25, 2018
1 parent 773d7eb commit c33ca59
Showing 1 changed file with 16 additions and 10 deletions.
Expand Up @@ -489,24 +489,30 @@ sealed class TransactionBoundQueryContext(val transactionalContext: Transactiona
val group = transactionalContext.cursors.allocateRelationshipGroupCursor()
try {
reads().singleNode(node, cursor)
dir match {
case OUTGOING => Nodes.countOutgoing(cursor, group)
case INCOMING => Nodes.countIncoming(cursor, group)
case BOTH => Nodes.countAll(cursor, group)
if (!cursor.next()) 0
else {
dir match {
case OUTGOING => Nodes.countOutgoing(cursor, group)
case INCOMING => Nodes.countIncoming(cursor, group)
case BOTH => Nodes.countAll(cursor, group)
}
}
} finally group.close()

}
finally group.close()
}

override def nodeGetDegree(node: Long, dir: SemanticDirection, relTypeId: Int): Int = {
val cursor = nodeCursor
val group = transactionalContext.cursors.allocateRelationshipGroupCursor()
try {
reads().singleNode(node, cursor)
dir match {
case OUTGOING => Nodes.countOutgoing(cursor, group, relTypeId)
case INCOMING => Nodes.countIncoming(cursor, group, relTypeId)
case BOTH => Nodes.countAll(cursor, group, relTypeId)
if (!cursor.next()) 0
else {
dir match {
case OUTGOING => Nodes.countOutgoing(cursor, group, relTypeId)
case INCOMING => Nodes.countIncoming(cursor, group, relTypeId)
case BOTH => Nodes.countAll(cursor, group, relTypeId)
}
}
} finally group.close()
}
Expand Down

0 comments on commit c33ca59

Please sign in to comment.