@@ -34,18 +34,17 @@ namespace internal{
34
34
data_ (other.data_), dim_(other.dim_) {}
35
35
36
36
inline DimNameProxy& operator =(SEXP other) {
37
- SEXP dim = Rf_getAttrib (data_, R_DimSymbol);
38
- if (INTEGER (dim )[dim_] != Rf_length (other)) {
37
+ SEXP dims = Rf_getAttrib (data_, R_DimSymbol);
38
+ if (INTEGER (dims )[dim_] != Rf_length (other)) {
39
39
std::stringstream s;
40
40
s << " dimension extent is '"
41
- << INTEGER (dim )[dim_]
41
+ << INTEGER (dims )[dim_]
42
42
<< " ' while length of names is '"
43
43
<< Rf_length (other)
44
44
<< " '" ;
45
45
stop (s.str ());
46
46
}
47
47
SEXP dimnames = Rf_getAttrib (data_, R_DimNamesSymbol);
48
- SEXP dims = Rf_getAttrib (data_, R_DimSymbol);
49
48
if (Rf_isNull (dimnames)) {
50
49
Shield<SEXP> new_dimnames (Rf_allocVector (VECSXP, Rf_length (dims)));
51
50
SET_VECTOR_ELT (new_dimnames, dim_, other);
@@ -55,20 +54,20 @@ namespace internal{
55
54
}
56
55
return *this ;
57
56
}
57
+
58
58
59
- inline DimNameProxy& operator =(const DimNameProxy& other) {
60
- SEXP dim = Rf_getAttrib (data_, R_DimSymbol);
61
- if (INTEGER (dim )[dim_] != INTEGER (dim )[other.dim_ ]) {
59
+ inline DimNameProxy& operator =(const DimNameProxy& other) {
60
+ SEXP dims = Rf_getAttrib (data_, R_DimSymbol);
61
+ if (INTEGER (dims )[dim_] != INTEGER (dims )[other.dim_ ]) {
62
62
std::stringstream s;
63
63
s << " dimension extent is '"
64
- << INTEGER (dim )[dim_]
64
+ << INTEGER (dims )[dim_]
65
65
<< " ' while length of names is '"
66
- << INTEGER (dim )[other.dim_ ]
66
+ << INTEGER (dims )[other.dim_ ]
67
67
<< " '" ;
68
68
stop (s.str ());
69
69
}
70
70
SEXP dimnames = Rf_getAttrib (data_, R_DimNamesSymbol);
71
- SEXP dims = Rf_getAttrib (data_, R_DimSymbol);
72
71
SEXP other_dimnames = SEXP (other);
73
72
if (Rf_isNull (dimnames)) {
74
73
Shield<SEXP> new_dimnames (Rf_allocVector (VECSXP, Rf_length (dims)));
@@ -79,6 +78,7 @@ namespace internal{
79
78
}
80
79
return *this ;
81
80
}
81
+
82
82
83
83
84
84
inline operator SEXP () const {
0 commit comments