vnma0 / wafter

Mirai's Back-end & API Server
MIT License
4 stars 3 forks source link

Bitmask-based verdict #101

Closed minhducsun2002 closed 3 years ago

minhducsun2002 commented 5 years ago

Verdicts should be expressed as bit patterns ORed together, allowing quicker checks and easier parsing compared to hardcoded strings.

dungwinux commented 5 years ago

@minhducsun2002, what do you mean? The verdict parsing is actually a function, giving you the freedom of parsing the score to your liking. No need to enforce bitmask or anything

minhducsun2002 commented 5 years ago

I mean the responses from the API.

I suggest using 1, 2, 4, ... instead of CE, WA, TLE or so.

In case of multiple verdicts, values representing each distinct verdict can be OR-ed (like 1 OR 2 = 3).

Much easier than hardcoding strings like CE, WA and TLE.

dungwinux commented 5 years ago

It's gonna be hard to extend, and such optimization is not necessary for now. You may want to prototype idea first, since it is not easy to quickly adapt.