* WriteMultipleRoles iterates through the roles HTAB and writes each role to the provided BSON array writer. * This is used to write roles for usersInfo and connectionStatus commands. */
| 1714 | * This is used to write roles for usersInfo and connectionStatus commands. |
| 1715 | */ |
| 1716 | static void |
| 1717 | WriteMultipleRoles(HTAB *rolesTable, pgbson_array_writer *roleArrayWriter) |
| 1718 | { |
| 1719 | if (rolesTable == NULL) |
| 1720 | { |
| 1721 | return; |
| 1722 | } |
| 1723 | |
| 1724 | HASH_SEQ_STATUS status; |
| 1725 | StringView *roleEntry; |
| 1726 | hash_seq_init(&status, rolesTable); |
| 1727 | while ((roleEntry = hash_seq_search(&status)) != NULL) |
| 1728 | { |
| 1729 | WriteRoles(roleEntry->string, roleArrayWriter); |
| 1730 | } |
| 1731 | } |
| 1732 | |
| 1733 | |
| 1734 | /* |
no test coverage detected