immediateParent is cheaper than Parent, but assumes !ci.isFace().
()
| 181 | |
| 182 | // immediateParent is cheaper than Parent, but assumes !ci.isFace(). |
| 183 | func (ci CellID) immediateParent() CellID { |
| 184 | nlsb := CellID(ci.lsb() << 2) |
| 185 | return (ci & -nlsb) | nlsb |
| 186 | } |
| 187 | |
| 188 | // isFace returns whether this is a top-level (face) cell. |
| 189 | func (ci CellID) isFace() bool { return uint64(ci)&(lsbForLevel(0)-1) == 0 } |