[Webkit-unassigned] [Bug 33178] Segmented SharedBuffer: SharedBuffer doesn't have to be a flat memory block

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 5 08:36:40 PST 2010


--- Comment #22 from Darin Adler <darin at apple.com>  2010-01-05 08:36:39 PST ---
> unsigned bytesToCopy = static_cast<unsigned>(length) < segmentFreeSpace ? static_cast<unsigned>(length) : segmentFreeSpace;

A more elegant way to write that is:

    unsigned bytesToCopy = min<unsigned>(length, segmentFreeSpace);

That gets rid of the casts too. In general, the min function is helpful for
these "how much more data to get out of a buffer" sites.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list