simplify several comparison operators

* spot/twaalgos/dtbasat.cc, spot/twaalgos/dtwasat.cc,
spot/twaalgos/simulation.cc: Simplify, as reported by sonarcloud.
This commit is contained in:
Alexandre Duret-Lutz 2023-01-05 17:48:14 +01:00
parent 403e55d555
commit 344d82f2b4
3 changed files with 6 additions and 20 deletions

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2013-2018, 2021, 2022 Laboratoire de Recherche et // Copyright (C) 2013-2018, 2021-2023 Laboratoire de Recherche et
// Développement de l'Epita. // Développement de l'Epita.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -77,11 +77,7 @@ namespace spot
return true; return true;
if (this->src_ref > other.src_ref) if (this->src_ref > other.src_ref)
return false; return false;
if (this->dst_ref < other.dst_ref) return this->dst_ref < other.dst_ref;
return true;
if (this->dst_ref > other.dst_ref)
return false;
return false;
} }
}; };

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2013-2022 Laboratoire de Recherche // Copyright (C) 2013-2023 Laboratoire de Recherche
// et Développement de l'Epita. // et Développement de l'Epita.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -98,11 +98,7 @@ namespace spot
return true; return true;
if (this->acc_ref > other.acc_ref) if (this->acc_ref > other.acc_ref)
return false; return false;
if (this->acc_cand < other.acc_cand) return this->acc_cand < other.acc_cand;
return true;
if (this->acc_cand > other.acc_cand)
return false;
return false;
} }
}; };

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012-2022 Laboratoire de Recherche et Développement // Copyright (C) 2012-2023 Laboratoire de Recherche et Développement
// de l'Epita (LRDE). // de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -93,13 +93,7 @@ namespace spot
return true; return true;
if (states > r.states) if (states > r.states)
return false; return false;
return edges < r.edges;
if (edges < r.edges)
return true;
if (edges > r.edges)
return false;
return false;
} }
inline bool operator>(const automaton_size& r) inline bool operator>(const automaton_size& r)