EngineSnapLen returns the number of root snapshots currently held by the engine, or -1 if the pointer is nil.
(eng *Engine)
| 42 | // EngineSnapLen returns the number of root snapshots currently held |
| 43 | // by the engine, or -1 if the pointer is nil. |
| 44 | func EngineSnapLen(eng *Engine) int { |
| 45 | p := eng.snap.Load() |
| 46 | if p == nil { |
| 47 | return -1 |
| 48 | } |
| 49 | return len(*p) |
| 50 | } |
| 51 | |
| 52 | // DefaultScoreParamsForTest exposes defaultScoreParams for tests. |
| 53 | var DefaultScoreParamsForTest = defaultScoreParams |
no test coverage detected