retrive GraphContext from the global array graph isn't registered, NULL is returned graph's references count isn't increased! this is OK as long as only a single thread has access to the graph
| 780 | // graph's references count isn't increased! |
| 781 | // this is OK as long as only a single thread has access to the graph |
| 782 | GraphContext *GraphContext_UnsafeGetGraphContext |
| 783 | ( |
| 784 | const char *graph_name |
| 785 | ) { |
| 786 | KeySpaceGraphIterator it; |
| 787 | Globals_ScanGraphs(&it); |
| 788 | |
| 789 | GraphContext *gc = NULL; |
| 790 | |
| 791 | while((gc = GraphIterator_Next(&it)) != NULL) { |
| 792 | bool match = (strcmp(gc->graph_name, graph_name) == 0); |
| 793 | GraphContext_DecreaseRefCount(gc); |
| 794 | if(match == true) { |
| 795 | break; |
| 796 | } |
| 797 | } |
| 798 | |
| 799 | return gc; |
| 800 | } |
| 801 | |
| 802 | //------------------------------------------------------------------------------ |
| 803 | // Slowlog API |
no test coverage detected