func calculateUserInstructionSets(r *Runner, hs b.Homeserver) [][]instruction {
	sets := make([][]instruction, r.userConcurrency)

	createdUsers := make(map[string]bool)
	// add instructions to create users
	for _, user := range hs.Users {
		i := indexFor(user.Localpart, r.userConcurrency)
		instrs := sets[i]

		if createdUsers[user.Localpart] {
			// login instead as the device ID may be different
			instrs = append(instrs, instructionLogin(hs, user))
		} else {
			instrs = append(instrs, instructionRegister(hs, user))
		}
		createdUsers[user.Localpart] = true

		if user.OneTimeKeys > 0 {
			instrs = append(instrs, instructionOneTimeKeyUpload(hs, user))
		}
		sets[i] = instrs
	}
	return sets
}
// calculateUserInstructionSets returns sets of HTTP requests to be executed in order. Sets can be executed in any order.
calculateUserInstructionSets returns sets of HTTP requests to be executed in order. Sets can be executed in any order.
// calculateUserInstructionSets returns sets of HTTP requests to be executed in order . Sets can be executed in any order .
func calculateUserInstructionSets(r *Runner, hs b.Homeserver) [][]instruction {
	sets := make([][]instruction, r.userConcurrency)
	createdUsers := make(map[string]bool)
	for _, user := range hs.Users {
		i := indexFor(user.Localpart, r.userConcurrency)
		instrs := sets[i]
		if createdUsers[user.Localpart] {
			instrs = append(instrs, instructionLogin(hs, user))
		} else {
			instrs = append(instrs, instructionRegister(hs, user))
		}
		createdUsers[user.Localpart] = true
		if user.OneTimeKeys > 0 {
			instrs = append(instrs, instructionOneTimeKeyUpload(hs, user))
		}
		sets[i] = instrs
	}
	return sets
}
func calculateUserInstructionSets ( r * Runner , hs b . Homeserver ) [ ] [ ] instruction { sets := make ( [ ] [ ] instruction , r . userConcurrency ) createdUsers := make ( map [ string ] bool ) for _ , user := range hs . Users { i := indexFor ( user . Localpart , r . userConcurrency ) instrs := sets [ i ] if createdUsers [ user . Localpart ] { instrs = append ( instrs , instructionLogin ( hs , user ) ) } else { instrs = append ( instrs , instructionRegister ( hs , user ) ) } createdUsers [ user . Localpart ] = true if user . OneTimeKeys > 0 { instrs = append ( instrs , instructionOneTimeKeyUpload ( hs , user ) ) } sets [ i ] = instrs } return sets }
calculateUserInstructionSets returns sets of HTTP requests to be executed in order.
calculateUserInstructionSets returns sets of HTTP requests to be executed in order .
// add instructions to create users // login instead as the device ID may be different