(relIdx int)
| 214 | } |
| 215 | |
| 216 | func (g *Graph) getRelation(relIdx int) string { |
| 217 | if relIdx >= len(g.relationshipTypes) { |
| 218 | // Missing relation type, refresh relation type mapping table. |
| 219 | g.mutex.Lock() |
| 220 | |
| 221 | // Recheck now that we've got the lock. |
| 222 | if relIdx >= len(g.relationshipTypes) { |
| 223 | g.relationshipTypes = g.RelationshipTypes() |
| 224 | // Retry. |
| 225 | if relIdx >= len(g.relationshipTypes) { |
| 226 | // Error! |
| 227 | panic("Unknown relation type index.") |
| 228 | } |
| 229 | } |
| 230 | g.mutex.Unlock() |
| 231 | } |
| 232 | |
| 233 | return g.relationshipTypes[relIdx] |
| 234 | } |
| 235 | |
| 236 | func (g *Graph) getProperty(propIdx int) string { |
| 237 | if propIdx >= len(g.properties) { |
no test coverage detected