From 282ee132467939f1faa8b902c0a826f3527de70e Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 16 Aug 2015 21:16:26 +0000 Subject: [PATCH] [IR] Simplify code. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245188 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/Type.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/IR/Type.cpp b/lib/IR/Type.cpp index c3c3f492b5b..649962690dd 100644 --- a/lib/IR/Type.cpp +++ b/lib/IR/Type.cpp @@ -605,13 +605,11 @@ bool StructType::isValidElementType(Type *ElemTy) { /// specified struct. bool StructType::isLayoutIdentical(StructType *Other) const { if (this == Other) return true; - - if (isPacked() != Other->isPacked() || - getNumElements() != Other->getNumElements()) + + if (isPacked() != Other->isPacked()) return false; - - return element_begin() && - std::equal(element_begin(), element_end(), Other->element_begin()); + + return elements() == Other->elements(); } /// getTypeByName - Return the type with the specified name, or null if there -- 2.34.1