*: add "noexcept" to many, many function prototypes

This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
This commit is contained in:
Max Kellermann
2017-05-08 14:44:49 +02:00
parent ac2e4e593d
commit 71f0ed8b74
272 changed files with 873 additions and 846 deletions

View File

@@ -40,23 +40,23 @@ struct ReplayGainTuple {
}
gcc_pure
float CalculateScale(const ReplayGainConfig &config) const;
float CalculateScale(const ReplayGainConfig &config) const noexcept;
};
struct ReplayGainInfo {
ReplayGainTuple track, album;
constexpr bool IsDefined() const {
constexpr bool IsDefined() const noexcept {
return track.IsDefined() || album.IsDefined();
}
const ReplayGainTuple &Get(ReplayGainMode mode) const {
const ReplayGainTuple &Get(ReplayGainMode mode) const noexcept {
return mode == ReplayGainMode::ALBUM
? (album.IsDefined() ? album : track)
: (track.IsDefined() ? track : album);
}
void Clear() {
void Clear() noexcept {
track.Clear();
album.Clear();
}