Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 0d78f1e

Browse files
committed
Reduce repetition in target_is_apple.
1 parent 9429e64 commit 0d78f1e

File tree

1 file changed

+6
-5
lines changed
  • compiler/rustc_codegen_llvm/src/back

1 file changed

+6
-5
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -944,11 +944,12 @@ fn create_section_with_flags_asm(section_name: &str, section_flags: &str, data:
944944
}
945945

946946
fn target_is_apple(cgcx: &CodegenContext<LlvmCodegenBackend>) -> bool {
947-
cgcx.opts.target_triple.triple().contains("-ios")
948-
|| cgcx.opts.target_triple.triple().contains("-darwin")
949-
|| cgcx.opts.target_triple.triple().contains("-tvos")
950-
|| cgcx.opts.target_triple.triple().contains("-watchos")
951-
|| cgcx.opts.target_triple.triple().contains("-visionos")
947+
let triple = cgcx.opts.target_triple.triple();
948+
triple.contains("-ios")
949+
|| triple.contains("-darwin")
950+
|| triple.contains("-tvos")
951+
|| triple.contains("-watchos")
952+
|| triple.contains("-visionos")
952953
}
953954

954955
fn target_is_aix(cgcx: &CodegenContext<LlvmCodegenBackend>) -> bool {

0 commit comments

Comments
 (0)