mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
fix: CodeQL warnings
This commit is contained in:
parent
4e3abd4601
commit
f1c33253c7
@ -462,7 +462,7 @@ class uint128_t {
|
||||
tmp <<= left;
|
||||
uint128_t quotient(0);
|
||||
uint128_t zero(0);
|
||||
while (left >= 0 && tmp2 >= p) {
|
||||
while (tmp2 >= p) {
|
||||
uint16_t shf = tmp2._lez() - tmp._lez();
|
||||
if (shf) {
|
||||
tmp >>= shf;
|
||||
|
@ -429,7 +429,7 @@ class uint256_t {
|
||||
tmp <<= left;
|
||||
uint256_t quotient(0);
|
||||
uint256_t zero(0);
|
||||
while (left >= 0 && tmp2 >= p) {
|
||||
while (tmp2 >= p) {
|
||||
uint16_t shf = tmp2._lez() - tmp._lez();
|
||||
if (shf) {
|
||||
tmp >>= shf;
|
||||
|
@ -128,6 +128,7 @@ int32_t list::top() {
|
||||
} catch (const std::exception &e) {
|
||||
std::cerr << "List is empty" << e.what() << '\n';
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* @brief Utility function to find the last element of the list
|
||||
@ -145,6 +146,7 @@ int32_t list::last() {
|
||||
} catch (const std::exception &e) {
|
||||
std::cerr << "List is empty" << e.what() << '\n';
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* @brief Utility function to find the i th element of the list
|
||||
@ -165,6 +167,7 @@ int32_t list::traverse(int index) {
|
||||
/* if we get to this line,the caller was asking for a non-existent element
|
||||
so we assert fail */
|
||||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace linked_list
|
||||
|
Loading…
Reference in New Issue
Block a user