Trying to avoid unnecessary allocations to handle a corner case.