GetFunctionComparer returns the function comparer for a specific engine. If no engine-specific comparer is registered, it returns the default comparer.
(engine storepb.Engine)
| 88 | // GetFunctionComparer returns the function comparer for a specific engine. |
| 89 | // If no engine-specific comparer is registered, it returns the default comparer. |
| 90 | func GetFunctionComparer(engine storepb.Engine) FunctionComparer { |
| 91 | functionComparerRegistryMux.RLock() |
| 92 | defer functionComparerRegistryMux.RUnlock() |
| 93 | |
| 94 | if comparer, exists := functionComparerRegistry[engine]; exists { |
| 95 | return comparer |
| 96 | } |
| 97 | |
| 98 | // Return default comparer if no engine-specific one is registered |
| 99 | return &DefaultFunctionComparer{} |
| 100 | } |
| 101 | |
| 102 | func init() { |
| 103 | // Register default comparers for engines that don't need specialized logic |