projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e39dfd9
)
Add non-const operator[] to TypedIOBuf
author
Tudor Bosman
<tudorb@fb.com>
Tue, 15 Apr 2014 16:24:11 +0000
(09:24 -0700)
committer
Sara Golemon
<sgolemon@fb.com>
Fri, 18 Apr 2014 19:04:15 +0000
(12:04 -0700)
Test Plan: used it
Reviewed By: lucian@fb.com
FB internal diff:
D1277063
@override-unit-failures
folly/io/TypedIOBuf.h
patch
|
blob
|
history
diff --git
a/folly/io/TypedIOBuf.h
b/folly/io/TypedIOBuf.h
index 26eccccca8e3ec2ebc97828ebb4118e97607be91..c5ecfc484837502d1c8ec6536e9882c15cc0800e 100644
(file)
--- a/
folly/io/TypedIOBuf.h
+++ b/
folly/io/TypedIOBuf.h
@@
-153,6
+153,11
@@
class TypedIOBuf {
return data()[idx];
}
+ T& operator[](ssize_t idx) {
+ assert(idx >= 0 && idx < length());
+ return writableData()[idx];
+ }
+
/**
* Append one element.
*/