Skip to content

Commit 8cdf41f

Browse files
committed
ab_tree: make MID-to-GUID conversion syntactically more obvious
1 parent 7379661 commit 8cdf41f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/gromox/ab_tree.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct GX_EXPORT minid {
125125
*/
126126
constexpr minid(Type t, uint32_t v) : id((uint32_t(t) << TYPEOFFSET) | ((v + 0x10) & VALMASK)) {}
127127
constexpr operator uint32_t() const { return id; }
128-
constexpr explicit operator GUID() const { return GUID{id, 0, 0, {0, 0}, {0, 0, 0, 0, 0, 0}}; }
128+
constexpr GUID to_guid() const { return GUID{id, 0, 0, {0, 0}, {0, 0, 0, 0, 0, 0}}; }
129129

130130
constexpr Type type() const { return Type(id >> TYPEOFFSET); } ///< Extract type from minid
131131
constexpr uint32_t value() const { return (id & VALMASK) - 0x10; } ///< Extract object ID from minid

lib/ab_tree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ bool ab_base::dn(minid mid, std::string& essdn) const
315315
const sql_user *user = fetch_user(mid);
316316
if(!user) {
317317
char guid_str[33];
318-
GUID(mid).to_str(guid_str, std::size(guid_str));
318+
mid.to_guid().to_str(guid_str, std::size(guid_str));
319319
essdn = "/guid=";
320320
essdn += guid_str;
321321
return true;

0 commit comments

Comments
 (0)