Skip to content

Commit 80e69c6

Browse files
committed
Merge pull request #150 from romainfrancois/master
ifelse was broken -- thank you!
2 parents 49d7908 + 263a690 commit 80e69c6

File tree

1 file changed

+2
-2
lines changed
  • inst/include/Rcpp/sugar/functions

1 file changed

+2
-2
lines changed

inst/include/Rcpp/sugar/functions/ifelse.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// ifelse.h: Rcpp R/C++ interface class library -- ifelse
44
//
5-
// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
5+
// Copyright (C) 2010 - 2014 Dirk Eddelbuettel and Romain Francois
66
//
77
// This file is part of Rcpp.
88
//
@@ -54,7 +54,7 @@ class IfElse : public VectorBase<
5454

5555
inline STORAGE operator[]( int i ) const {
5656
int x = cond[i] ;
57-
if( Rcpp::traits::is_na<LGLSXP>(x) ) return x ;
57+
if( Rcpp::traits::is_na<LGLSXP>(x) ) return Rcpp::traits::get_na<RTYPE>() ;
5858
if( x ) return lhs[i] ;
5959
return rhs[i] ;
6060
}

0 commit comments

Comments
 (0)