kasparsklavins / bigint

A lightweight big integer library for c++
MIT License
220 stars 55 forks source link

Dead code found at line 78 #10

Closed ghost closed 7 years ago

ghost commented 7 years ago

In file bigint.cpp around line 73, I found this code:

Bigint &Bigint::operator+=(Bigint const &b)
{
    if (!b.positive) {
        return *this -= b;
    }
    if (!b.positive && positive) {
        positive = false;
    }

The first if make it returned when !b.positive, then the second if can't be true, right? So it should be dead code

ghost commented 7 years ago

pull #11

ghost commented 7 years ago

pull #11 closed. pull #12 instead

kasparsklavins commented 7 years ago

Closed since https://github.com/kasparsklavins/bigint/pull/12 has been merged.