spatialConfigsEqual checks if two spatial index configurations are equal.
(cfg1, cfg2 *storepb.SpatialIndexConfig)
| 873 | |
| 874 | // spatialConfigsEqual checks if two spatial index configurations are equal. |
| 875 | func spatialConfigsEqual(cfg1, cfg2 *storepb.SpatialIndexConfig) bool { |
| 876 | if cfg1 == nil && cfg2 == nil { |
| 877 | return true |
| 878 | } |
| 879 | if cfg1 == nil || cfg2 == nil { |
| 880 | return false |
| 881 | } |
| 882 | |
| 883 | // Compare method |
| 884 | if cfg1.Method != cfg2.Method { |
| 885 | return false |
| 886 | } |
| 887 | |
| 888 | // Compare tessellation config |
| 889 | if !tessellationConfigsEqual(cfg1.Tessellation, cfg2.Tessellation) { |
| 890 | return false |
| 891 | } |
| 892 | |
| 893 | // Compare storage config |
| 894 | if !storageConfigsEqual(cfg1.Storage, cfg2.Storage) { |
| 895 | return false |
| 896 | } |
| 897 | |
| 898 | // Compare dimensional config |
| 899 | if !dimensionalConfigsEqual(cfg1.Dimensional, cfg2.Dimensional) { |
| 900 | return false |
| 901 | } |
| 902 | |
| 903 | // Compare engine-specific parameters |
| 904 | if len(cfg1.EngineSpecific) != len(cfg2.EngineSpecific) { |
| 905 | return false |
| 906 | } |
| 907 | for key, val1 := range cfg1.EngineSpecific { |
| 908 | val2, exists := cfg2.EngineSpecific[key] |
| 909 | if !exists || val1 != val2 { |
| 910 | return false |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | return true |
| 915 | } |
| 916 | |
| 917 | // tessellationConfigsEqual checks if two tessellation configurations are equal. |
| 918 | func tessellationConfigsEqual(cfg1, cfg2 *storepb.TessellationConfig) bool { |
no test coverage detected