Just move quickly.

Or, a more practical solution is to pull a skirt on over the shorts, then pull the shorts down under the skirt. You can also use a towel wrapped around you as a coverup skirt to accomplish this - that's an old swimteam trick.