fixup cpp compile fault

Signed-off-by: Fuang.Cao <cavan.cfa@gmail.com>
optimalize compile speed

Signed-off-by: Fuang.Cao <cavan.cfa@gmail.com>