mirror of
https://github.com/facebook/sapling.git
synced 2025-01-08 22:56:44 +03:00
1a562484b1
Summary: Migrate the code from accessing optional Thrift fields directly to a safer `optional_field_ref` API. See https://fburl.com/safe for more details. The output of this codemod has been reviewed in D13259011. To preserve semantics, each unchecked access is replaced with an explicit call to `value_unchecked()`. If you are sure that accessing a field is safe (the field is marked as set), you can later replace `value_unchecked()` with `value()` or dereferencing (`operator *`): ``` ThriftStruct s = ... - auto foo = s.foo_ref().value_unchecked(); + auto foo = *s.foo_ref(); // will throw if s.foo is unset ``` Reviewed By: fanzeyi Differential Revision: D15078040 fbshipit-source-id: 8ef270e8c687535e9d4aa2208beff4517e121814 |
||
---|---|---|
.. | ||
benchharness | ||
config | ||
fuse | ||
inodes | ||
journal | ||
model | ||
rocksdb | ||
service | ||
sqlite | ||
store | ||
takeover | ||
testharness | ||
tracing | ||
utils | ||
CMakeLists.txt |