insert cluster UUIDs when loading location logs, and omit when saving

Inline isClusterUUID for speed.
This commit is contained in:
Joey Hess 2024-06-14 18:06:28 -04:00
parent a4c9d4424c
commit b3370a191c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 55 additions and 23 deletions

View file

@ -11,6 +11,7 @@ module Types.Cluster (
ClusterUUID,
mkClusterUUID,
genClusterUUID,
fromClusterUUID,
isClusterUUID,
fromClusterUUID,
ClusterNodeUUID(..),
@ -52,6 +53,8 @@ isClusterUUID (UUID b)
eight = fromIntegral (ord '8')
isClusterUUID _ = False
{-# INLINE isClusterUUID #-}
-- Generates a ClusterUUID from any regular UUID (eg V4).
-- It is converted to a valid cluster UUID.
genClusterUUID :: UUID -> Maybe ClusterUUID