core: avoid lgtm warning in _sleep_duration_convert_ms_to_us()

return x < G_MAXULONG ? (gulong) x : G_MAXULONG;
  ^^^ Comparison is always true because x <= 4294967295000.
This commit is contained in:
Thomas Haller 2021-06-01 17:39:25 +02:00
parent ecd5d07b3a
commit bc05f4b750
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -587,7 +587,8 @@ _sleep_duration_convert_ms_to_us(guint32 sleep_duration_msec)
if (sleep_duration_msec > 0) {
guint64 x = ((guint64) sleep_duration_msec) * 1000UL;
return x < G_MAXULONG ? (gulong) x : G_MAXULONG;
nm_assert(x < G_MAXULONG);
return x;
}
return G_USEC_PER_SEC / 20;
}