ternary, not too complicated

pull/24335/head
Shane Smiskol 3 years ago
parent 24585a76bc
commit 830f64e02c
  1. 7
      selfdrive/ui/qt/widgets/cameraview.cc

@ -222,11 +222,8 @@ void CameraViewWidget::paintGL() {
VisionBuf *latest_frame; VisionBuf *latest_frame;
std::deque<quint32>::iterator it = std::find(frame_ids.begin(), frame_ids.end(), draw_frame_id); std::deque<quint32>::iterator it = std::find(frame_ids.begin(), frame_ids.end(), draw_frame_id);
if (it == frame_ids.end()) { int frame_idx = (it == frame_ids.end()) ? (frames.size() - 1) : (it - frame_ids.begin());
latest_frame = frames[frames.size() - 1]; latest_frame = frames[frame_idx];
} else {
latest_frame = frames[it - frame_ids.begin()];
}
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glViewport(0, 0, width(), height()); glViewport(0, 0, width(), height());

Loading…
Cancel
Save