Fix unnecessary and potentially unsafe .data() on StringRef
Don't use ternary operator for side effects