关于 fbstring initsmall() 方法的问题

问题描述

我正在阅读愚蠢的源代码。看了fbstring的实现,对initsmall函数的实现一头雾水。
如果 bytesize 为 17,wordsize 为 8,则 (byteSize + wordWidth-1) / wordWidth 为 3。 reinterpret_cast>(data)[2] 是否访问 data 的第 17 个字符元素和以下 7 个元素?不会越界了吧?
下面是实现代码,完整代码https://github.com/facebook/folly/blame/master/folly/FBString.h

const [state,setState] = React.useState(() => //Read the value from the fireStore);

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)