Remove redundant check in encoding.