[SERVER-1496] StringData should have an explicit constructor taking both a const char* and a length Created: 27/Jul/10 Updated: 12/Jul/16 Resolved: 28/Jul/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client |
| Affects Version/s: | 1.5.6 |
| Fix Version/s: | 1.5.7 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
all |
||
| Participants: |
| Description |
|
If you already know the length of a const char*, but that const char* doesn't happen to be a string literal, there is currently no way to construct a StringData object that captures both the string pointer and the known length without an additional call to strlen. Adding an new constructor that takes a const char* and a length would fix this. I have a patch for this in progress and I will post a github pull request with the fix later today, so feel free to assign it to me, or to Alberto if that is not possible. |
| Comments |
| Comment by auto [ 27/Jul/10 ] |
|
Author: {'login': 'acmorrow', 'name': 'Andrew C. Morrow', 'email': 'andrew.c.morrow@gmail.com'}Message: |