The comment should be something like 

// Could be eq check (faster) if we could guarantee that.ks + key
// would return that.ks if it already contains the key

so that we don't lose the effort noting that this would be better, but we say exactly what preconditions are required.