inlined discardAllInput