Skip to content

Commit b402206

Browse files
committed
Clean-up: use local variable instead of repeated function call
1 parent 9e35f14 commit b402206

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ColoringAction.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ void ColoringAction::updateScatterplotWidgetColorMap()
281281
{
282282
case ScatterplotWidget::SCATTERPLOT:
283283
{
284-
if (_colorByAction.getCurrentIndex() == 0) {
284+
const int32_t currentIndex = _colorByAction.getCurrentIndex();
285+
if (currentIndex == 0) {
285286
QPixmap colorPixmap(1, 1);
286287

287288
colorPixmap.fill(_constantColorAction.getColor());
@@ -290,7 +291,7 @@ void ColoringAction::updateScatterplotWidgetColorMap()
290291
scatterplotWidget.setScalarEffect(PointEffect::Color);
291292
scatterplotWidget.setColoringMode(ScatterplotWidget::ColoringMode::Constant);
292293
}
293-
else if (_colorByAction.getCurrentIndex() == 1) {
294+
else if (currentIndex == 1) {
294295
scatterplotWidget.setColorMap(_colorMap2DAction.getColorMapImage());
295296
scatterplotWidget.setScalarEffect(PointEffect::Color2D);
296297
scatterplotWidget.setColoringMode(ScatterplotWidget::ColoringMode::Scatter);

0 commit comments

Comments
 (0)