use new llvm::Optional API

`getValue` -> `value`
`getValueOr` -> `value_or`
`hasValue` -> `has_value`
`map` -> `transform`

The old API will be deprecated in the rebranch.
To avoid merge conflicts, use the new API already in the main branch.

rdar://102362022
This commit is contained in:
Erik Eckstein
2022-11-15 15:08:30 +01:00
parent 567b68aa6f
commit ab1b343dad
328 changed files with 1537 additions and 1536 deletions

View File

@@ -1288,7 +1288,7 @@ bool swift::omitNeedlessWords(StringRef &baseName,
// If the base name of a method imported as "async" starts with the word
// "get", drop the "get".
bool isAsync = completionHandlerIndex.hasValue();
bool isAsync = completionHandlerIndex.has_value();
if (isAsync && camel_case::getFirstWord(baseName) == "get" &&
baseName.size() > 3) {
baseName = baseName.substr(3);