forked from OSchip/llvm-project
[MLIR] Simplex::appendVariable: early return if count == 0
This commit is contained in:
parent
ec03bbe8a7
commit
76cb876563
|
@ -483,6 +483,8 @@ void Simplex::rollback(unsigned snapshot) {
|
|||
}
|
||||
|
||||
void Simplex::appendVariable(unsigned count) {
|
||||
if (count == 0)
|
||||
return;
|
||||
var.reserve(var.size() + count);
|
||||
colUnknown.reserve(colUnknown.size() + count);
|
||||
for (unsigned i = 0; i < count; ++i) {
|
||||
|
|
|
@ -388,6 +388,7 @@ TEST(SimplexTest, appendVariable) {
|
|||
|
||||
unsigned snapshot1 = simplex.getSnapshot();
|
||||
simplex.appendVariable();
|
||||
simplex.appendVariable(0);
|
||||
EXPECT_EQ(simplex.getNumVariables(), 2u);
|
||||
|
||||
int64_t yMin = 2, yMax = 5;
|
||||
|
|
Loading…
Reference in New Issue