Minorly improved efficency in random number generation and set delete for a pointer