mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar)
Replace `NameOfType foo = dyn_cast<NameOfType>(bar)` with DRY version `auto foo = dyn_cast<NameOfType>(bar)`. The DRY auto version is by far the dominant form already used in the repo, so this PR merely brings the exceptional cases (redundant repetition form) in line with the dominant form (auto form). See the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es11-use-auto-to-avoid-redundant-repetition-of-type-names) for a general discussion on why to use `auto` to avoid redundant repetition of type names.
This commit is contained in:
@@ -113,7 +113,7 @@ devirtualizeReleaseOfObject(SILInstruction *ReleaseInst,
|
||||
return false;
|
||||
|
||||
// Is the dealloc_ref paired with an alloc_ref?
|
||||
AllocRefInst *ARI = dyn_cast<AllocRefInst>(DeallocInst->getOperand());
|
||||
auto *ARI = dyn_cast<AllocRefInst>(DeallocInst->getOperand());
|
||||
if (!ARI)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user