Hi, > > > --- a/audio/audio_int.h > > > +++ b/audio/audio_int.h > > > @@ -266,6 +266,12 @@ static inline size_t audio_ring_dist(size_t dst, > > > size_t src, size_t len) > > > return (dst >= src) ? (dst - src) : (len - src + dst); > > > } > > You haven't touched this function, but while I am looking at it, all > > function > > arguments are unsigned. So probably modulo operator might be used to get rid > > of a branch here. > > That would be "return (len - dist + pos) % len;" but on my x86_64 system I > always prefer a conditional move instruction to a 64 bit integer division > instruction.
Why? Performance? Don't underestimate the optimizer of a modern compiler. In many cases it simply isn't worth the effort. Better optimize the code for humans, i.e. make it easy to read and understand. take care, Gerd