ProjectMoon / matrix-dicebot

This repository is mirrored from: https://git.agnos.is/projectmoon/matrix-dicebot
https://git.agnos.is/projectmoon/matrix-dicebot
Other
4 stars 1 forks source link

Better public API for user variables, avoid allocations in Context. #38

Closed ProjectMoon closed 4 years ago

ProjectMoon commented 4 years ago

The database API for user variables has changed somewhat again, this time closer to the proper vision. There are now two separate sled Trees in the Variables struct, one for user-defined variables, and one for counts. Keys have been changed to be username-first, then room ID. The signatures of the functions now also use a strongly-typed struct, UserAndRoom.

As part of this, the Context object now once again avoids allocating new strings.

Other random changes included here: