thomasbruggink commented on code in PR #3012:
URL: https://github.com/apache/thrift/pull/3012#discussion_r1748113640


##########
lib/lua/Thrift.lua:
##########
@@ -233,6 +235,35 @@ function TException:write(oprot)
   oprot:writeStructEnd()
 end
 
+TUUID = {
+  zero,
+  one,
+  two,
+  three
+}
+
+TUUID = __TObject:new{
+  __type = 'TUUID'
+}
+
+function TUUIDfromString(str)
+  local iterator = string.gmatch(str, 
"[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]")
+  return TUUID:new {
+    zero = libluabitwise.buor(libluabitwise.ushiftl(tonumber(iterator(), 16), 
16), tonumber(iterator(), 16)),

Review Comment:
   note that bitshifting was added in Lua 5.3, so if support for Lua 5.2 is 
dropped this implementation and the entire `libluabitwise` C module can be 
deleted.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to